mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -25,8 +26,12 @@ type Stream struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStream(key, secret string) *Stream {
|
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{
|
stream := &Stream{
|
||||||
websocketService: wss,
|
websocketService: wss,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user