From 760f108367daf440263f17f0098a10dbffcca31c Mon Sep 17 00:00:00 2001 From: mikeder Date: Wed, 20 Nov 2024 13:52:48 -0500 Subject: [PATCH] hold fix --- websocket.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/websocket.go b/websocket.go index 61c1a80..4e8b864 100644 --- a/websocket.go +++ b/websocket.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "net" - "net/url" "time" "github.com/gorilla/websocket" @@ -50,9 +49,8 @@ func Dial(address string, password string, options ...Option) (*Conn, error) { option(&settings) } - u := url.URL{Scheme: "ws", Host: address, Path: password} - - conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil) + u := fmt.Sprintf("ws://%s/%s", address, password) + conn, _, err := websocket.DefaultDialer.Dial(u, nil) if err != nil { if err.Error() == `malformed HTTP response "\x88\x02\x03\xe8"` { return nil, ErrAuthFailed