Skip to content

Commit

Permalink
add some feture
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengtao committed Jun 19, 2022
1 parent ed9da92 commit 49ed4b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions v2/futures/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const (
OrderTypeTakeProfit OrderType = "TAKE_PROFIT"
OrderTypeTakeProfitMarket OrderType = "TAKE_PROFIT_MARKET"
OrderTypeTrailingStopMarket OrderType = "TRAILING_STOP_MARKET"
OrderTypeOnlyMaker OrderType = "LIMIT_MAKER"

TimeInForceTypeGTC TimeInForceType = "GTC" // Good Till Cancel
TimeInForceTypeIOC TimeInForceType = "IOC" // Immediate or Cancel
Expand Down
10 changes: 9 additions & 1 deletion v2/futures/websocket.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package futures

import (
"fmt"
"net/http"
"net/url"
"time"

"github.com/gorilla/websocket"
Expand All @@ -24,7 +27,12 @@ func newWsConfig(endpoint string) *WsConfig {
}

var wsServe = func(cfg *WsConfig, handler WsHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) {
c, _, err := websocket.DefaultDialer.Dial(cfg.Endpoint, nil)
proxyURL, _ := url.Parse("http://127.0.0.1:11000")
dialer := websocket.Dialer{
Proxy: http.ProxyURL(proxyURL),
}
fmt.Println("add proxy")
c, _, err := dialer.Dial(cfg.Endpoint, nil)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 49ed4b2

Please sign in to comment.