mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-16 09:11:03 +08:00
This reverts commit 183e9273b8.
This commit is contained in:
committed by
tangmengqiu
parent
3451d7bfac
commit
575aef2156
18
README.md
18
README.md
@@ -1285,24 +1285,6 @@ sudo apt-get install libta-lib0-dev
|
|||||||
- If API fails, system uses default mainstream coins (BTC, ETH, etc.)
|
- 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*
|
- ~~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
|
## 📈 Performance Optimization Tips
|
||||||
|
|||||||
@@ -1302,24 +1302,6 @@ sudo apt-get install libta-lib0-dev
|
|||||||
- 如果API失败,系统会使用默认主流币种(BTC、ETH等)
|
- 如果API失败,系统会使用默认主流币种(BTC、ETH等)
|
||||||
- ~~检查config.json中的API URL和auth参数~~ *检查Web界面中的配置*
|
- ~~检查config.json中的API URL和auth参数~~ *检查Web界面中的配置*
|
||||||
|
|
||||||
### 6. 代理环境下 WebSocket 无法连接
|
|
||||||
|
|
||||||
**解决**:
|
|
||||||
- 启动后端前导出标准代理环境变量:
|
|
||||||
```bash
|
|
||||||
export HTTPS_PROXY=http://<代理主机>:<端口>
|
|
||||||
export HTTP_PROXY=http://<代理主机>:<端口>
|
|
||||||
|
|
||||||
# 如果代理需要账号密码
|
|
||||||
export HTTPS_PROXY=http://用户名:密码@<代理主机>:<端口>
|
|
||||||
export HTTP_PROXY=http://用户名:密码@<代理主机>:<端口>
|
|
||||||
|
|
||||||
# 正常启动 NOFX
|
|
||||||
./start.sh
|
|
||||||
```
|
|
||||||
- **Docker Compose**:将变量写到 `.env` 或 `docker-compose.yml` 的 `environment` 中。
|
|
||||||
- NOFX 使用 Go 的 `http.ProxyFromEnvironment`,只要环境变量设置正确,包括 Binance 合并流在内的所有出站请求都会自动走代理。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📈 性能优化建议
|
## 📈 性能优化建议
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
@@ -33,7 +32,6 @@ func NewCombinedStreamsClient(batchSize int) *CombinedStreamsClient {
|
|||||||
func (c *CombinedStreamsClient) Connect() error {
|
func (c *CombinedStreamsClient) Connect() error {
|
||||||
dialer := websocket.Dialer{
|
dialer := websocket.Dialer{
|
||||||
HandshakeTimeout: 10 * time.Second,
|
HandshakeTimeout: 10 * time.Second,
|
||||||
Proxy : http.ProxyFromEnvironment,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组合流使用不同的端点
|
// 组合流使用不同的端点
|
||||||
|
|||||||
Reference in New Issue
Block a user