diff --git a/whisper_live/client.py b/whisper_live/client.py index 4045ce20..f1e903eb 100644 --- a/whisper_live/client.py +++ b/whisper_live/client.py @@ -70,7 +70,10 @@ def __init__( self.audio_bytes = None if host is not None and port is not None: - socket_url = f"ws://{host}:{port}" + if port == 443: + socket_url = f"wss://{host}" + else: + socket_url = f"ws://{host}:{port}" self.client_socket = websocket.WebSocketApp( socket_url, on_open=lambda ws: self.on_open(ws), @@ -79,6 +82,7 @@ def __init__( on_close=lambda ws, close_status_code, close_msg: self.on_close( ws, close_status_code, close_msg ), + header=['User-Agent: WhisperLiveClient'] ) else: print("[ERROR]: No host or port specified.")