Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion whisper_live/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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.")
Expand Down