Skip to content

Commit 474f4d6

Browse files
authored
api-v0.1.3 & correctly translate scheme inside the TwirpClient (#84)
1 parent fbf1020 commit 474f4d6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

livekit-api/livekit/api/_twirp_client.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ class TwirpErrorCode:
5454
class TwirpClient:
5555
def __init__(self, host: str, pkg: str, prefix: str = DEFAULT_PREFIX) -> None:
5656
parse_res = urlparse(host)
57-
host = f"http://{parse_res.netloc}/{parse_res.path}"
57+
scheme = parse_res.scheme
58+
if scheme.startswith("ws"):
59+
scheme = scheme.replace("ws", "http")
60+
61+
host = f"{scheme}://{parse_res.netloc}/{parse_res.path}"
5862
self.host = host.rstrip("/")
5963
self.pkg = pkg
6064
self.prefix = prefix

livekit-api/livekit/api/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.2"
1+
__version__ = "0.1.3"

0 commit comments

Comments
 (0)