mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
max: load websocket base url from the env var
This commit is contained in:
parent
088b22f338
commit
24c4d05e91
|
@ -2,6 +2,7 @@ package max
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -25,8 +26,12 @@ type Stream struct {
|
|||
}
|
||||
|
||||
func NewStream(key, secret string) *Stream {
|
||||
wss := max.NewWebSocketService(max.WebSocketURL, key, secret)
|
||||
url := os.Getenv("MAX_API_WS_URL")
|
||||
if url == "" {
|
||||
url = max.WebSocketURL
|
||||
}
|
||||
|
||||
wss := max.NewWebSocketService(url, key, secret)
|
||||
stream := &Stream{
|
||||
websocketService: wss,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user