Skip to content

Commit 8281a5a

Browse files
author
litongjava
committed
feat: Select ws or wss automatically based on base URL scheme
1 parent 9db6550 commit 8281a5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/google/genai/AsyncLive.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ private URI getWebSocketUri() {
9292
}
9393
try {
9494
URI baseUri = new URI(baseUrl);
95+
String wsScheme = "https".equalsIgnoreCase(baseUri.getScheme()) ? "wss" : "ws";
9596
String wsBaseUrl =
9697
new URI(
97-
"wss",
98+
wsScheme,
9899
baseUri.getAuthority(),
99100
baseUri.getPath(),
100101
baseUri.getQuery(),

0 commit comments

Comments
 (0)