Skip to content

Commit

Permalink
WebSocketTransport: Replace "http*" with "ws*"
Browse files Browse the repository at this point in the history
  • Loading branch information
tufcode committed Aug 14, 2023
1 parent 4ce8d23 commit d92f113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "soketto-client",
"version": "1.0.2-release",
"version": "1.0.3-release",
"author": "Tufan Meriç Uyguner",
"license": "MIT",
"keywords": [],
Expand Down
3 changes: 3 additions & 0 deletions src/Transports/WebSocketTransport/WebSocketTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export class WebSocketTransport implements ITransport {
connect(serverAddr: string): void {
if (this._ws) throw new Error("Already connected or connecting");

serverAddr = serverAddr.replace("http", "ws");
serverAddr = serverAddr.replace("https", "wss");

this._ws = new WebSocket(serverAddr);
this._ws.binaryType = "arraybuffer";
this._ws.onopen = () => {
Expand Down

0 comments on commit d92f113

Please sign in to comment.