Skip to content

Commit e3d0846

Browse files
committed
Fix for PR #624 as per comment from @Tieske (previous version worked for the first, but not subsequent, connections)
Closes #623
1 parent e3fa503 commit e3d0846

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

netconn.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ import (
4040
func openConnection(uri *url.URL, tlsc *tls.Config, timeout time.Duration, headers http.Header, websocketOptions *WebsocketOptions, dialer *net.Dialer) (net.Conn, error) {
4141
switch uri.Scheme {
4242
case "ws":
43-
dialURI := uri // #623 - Gorilla Websockets does not accept URL's where uri.User != nil
44-
uri.User = nil
43+
dialURI := *uri // #623 - Gorilla Websockets does not accept URL's where uri.User != nil
44+
dialURI.User = nil
4545
conn, err := NewWebsocket(dialURI.String(), nil, timeout, headers, websocketOptions)
4646
return conn, err
4747
case "wss":
48-
dialURI := uri // #623 - Gorilla Websockets does not accept URL's where uri.User != nil
49-
uri.User = nil
48+
dialURI := *uri // #623 - Gorilla Websockets does not accept URL's where uri.User != nil
49+
dialURI.User = nil
5050
conn, err := NewWebsocket(dialURI.String(), tlsc, timeout, headers, websocketOptions)
5151
return conn, err
5252
case "mqtt", "tcp":

0 commit comments

Comments
 (0)