mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 06:46:59 +08:00
fix(api): market/combined_streams: Get Proxy form Environment (#879)
* fix(api): market/combined_streams: Get Proxy form Environment issues: ❌ 批量订阅流失败: 组合流WebSocket连接失败: dial tcp xxxxxx:443: i/o timeout Make environment variables effective for dialer.Dial("wss://fstream.binance.com/stream", nil): export HTTPS_PROXY=http://ip:port export HTTP_PROXY=http://ip:port Signed-off-by: MarsDoge <mars@dogexorg.com> * docs(WebSocket): add proxy usage guidance for combined streams (#475) Signed-off-by: MarsDoge <mars@dogexorg.com> --------- Signed-off-by: MarsDoge <mars@dogexorg.com>
This commit is contained in:
committed by
tangmengqiu
parent
9fc1870f5f
commit
e0af0d96e0
18
README.md
18
README.md
@@ -1285,6 +1285,24 @@ sudo apt-get install libta-lib0-dev
|
||||
- If API fails, system uses default mainstream coins (BTC, ETH, etc.)
|
||||
- ~~Check API URL and auth parameter in config.json~~ *Check configuration in web interface*
|
||||
|
||||
### 6. WebSocket can't connect when using an HTTP/HTTPS proxy
|
||||
|
||||
**Solution**:
|
||||
- Export standard proxy environment variables *before* starting the backend:
|
||||
```bash
|
||||
export HTTPS_PROXY=http://<proxy-host>:<port>
|
||||
export HTTP_PROXY=http://<proxy-host>:<port>
|
||||
|
||||
# If your proxy requires credentials
|
||||
export HTTPS_PROXY=http://user:pass@<proxy-host>:<port>
|
||||
export HTTP_PROXY=http://user:pass@<proxy-host>:<port>
|
||||
|
||||
# Start NOFX normally
|
||||
./start.sh
|
||||
```
|
||||
- **Docker Compose**: put the variables in `.env` or the service's `environment` block.
|
||||
- NOFX relies on Go's `http.ProxyFromEnvironment`, so every outbound request—including the Binance combined streams WebSocket—follows these proxy settings automatically when the variables are present.
|
||||
|
||||
---
|
||||
|
||||
## 📈 Performance Optimization Tips
|
||||
|
||||
Reference in New Issue
Block a user