'Connect to url. url is websocket url scheme.
ie. ws://host:port/resource
You can customize using \'options\'.
If you set "header" list object, you can set your own custom header.
>>> ws = WebSocket()
>>> ws.connect("ws://echo.websocket.org/",
...     header=["User-Agent: MyProgram",
...             "x-custom: header"])
timeout: socket timeout time. This value is integer.
if you set None for this value,
it means "use default_timeout value"
options: "header" -> custom http header list.
"cookie" -> cookie value.
"origin" -> custom origin url.
"host"   -> custom host header string.
"http_proxy_host" - http proxy host name.
"http_proxy_port" - http proxy port. If not set, set to 80.
"http_no_proxy"   - host names, which doesn\'t use proxy.
"http_proxy_auth" - http proxy auth infomation.
tuple of username and password.
defualt is None
"subprotocols" - array of available sub protocols.
default is None.'

def connect(self, url, **options):

    (self.sock, addrs) = connect(url, self.sock_opt, proxy_info(**options))
    try:
        self.handshake_response = handshake(self.sock, *addrs, **options)
        self.connected = True
    except:
        if self.sock:
            self.sock.close()
            self.sock = None
        raise
