diff --git a/sockjsclient/sockjsclient.go b/sockjsclient/sockjsclient.go
index <HASH>..<HASH> 100644
--- a/sockjsclient/sockjsclient.go
+++ b/sockjsclient/sockjsclient.go
@@ -76,6 +76,8 @@ func ConnectWebsocketSession(opts *DialOptions) (*WebsocketSession, error) {
 		ws.NetDial = func(network, addr string) (net.Conn, error) {
 			return net.DialTimeout(network, addr, opts.Timeout)
 		}
+		// this is used as Deadline inside gorillas dialer method
+		ws.HandshakeTimeout = opts.Timeout
 	}
 
 	conn, _, err := ws.Dial(dialURL.String(), requestHeader)
sockjsclient: set also deadline