'Initialize WebSocket object.'

def __init__(self, get_mask_key=None, sockopt=None, sslopt=None, fire_cont_frame=False, enable_multithread=False, skip_utf8_validation=False):

    self.sock_opt = sock_opt(sockopt, sslopt)
    self.handshake_response = None
    self.sock = None
    self.connected = False
    self.get_mask_key = get_mask_key
    self.frame_buffer = frame_buffer(self._recv, skip_utf8_validation)
    self.cont_frame = continuous_frame(fire_cont_frame, skip_utf8_validation)
    if enable_multithread:
        self.lock = threading.Lock()
    else:
        self.lock = NoLock()
