mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 08:16:56 +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
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
@@ -32,6 +33,7 @@ func NewCombinedStreamsClient(batchSize int) *CombinedStreamsClient {
|
||||
func (c *CombinedStreamsClient) Connect() error {
|
||||
dialer := websocket.Dialer{
|
||||
HandshakeTimeout: 10 * time.Second,
|
||||
Proxy : http.ProxyFromEnvironment,
|
||||
}
|
||||
|
||||
// 组合流使用不同的端点
|
||||
|
||||
Reference in New Issue
Block a user