Skip to content

Commit

Permalink
Update WebsocketPlus.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistium authored Nov 22, 2024
1 parent 4272b31 commit a23e090
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions featured/WebsocketPlus.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Made by @mistium on discord,
// this extension is for originOS :P
// Thanks for using my extension :D
// version 3.1
// version 3.2

// License: MPL-2.0
// This Source Code is subject to the terms of the Mozilla Public License, v2.0,
Expand Down Expand Up @@ -222,8 +222,10 @@
connectSecure({ URL, PORT }) {
const serverId = this.generateRandomId();
if (!this.wsServers[serverId]) {
URL = Cast.toString(URL);
PORT = Cast.toString(PORT);
let prepend = URL.startsWith("wss://") || URL.startsWith("ws://") ? "" : "wss://";
const ws = new WebSocket(prepend+`${Cast.toString(URL)}:${Cast.toString(PORT)}`);
const ws = new WebSocket(prepend+`${URL}:${PORT}`);
this.setupWebSocketHandlers(serverId, ws);
return serverId;
}
Expand Down

0 comments on commit a23e090

Please sign in to comment.