Skip to content

Commit

Permalink
Merge pull request #1 from mariusdw/configure_timeout
Browse files Browse the repository at this point in the history
Make handshake timeout configurable
  • Loading branch information
schwartzmx authored Aug 21, 2019
2 parents c44c4de + ee8f8a4 commit d15d64a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d15d64a

Please sign in to comment.