diff --git a/connection.go b/connection.go index e9d7e8bd..4e64d375 100644 --- a/connection.go +++ b/connection.go @@ -52,7 +52,7 @@ func (ws *Ws) connect() (err error) { d := websocket.Dialer{ WriteBufferSize: 8192, ReadBufferSize: 8192, - HandshakeTimeout: 5 * time.Second, // Timeout or else we'll hang forever and never fail on bad hosts. + HandshakeTimeout: ws.timeout, // Timeout or else we'll hang forever and never fail on bad hosts. } ws.conn, _, err = d.Dial(ws.host, http.Header{}) if err != nil {