WebSocket Secure

This commit is contained in:
2025-10-13 22:00:02 +02:00
parent 2c061a6f8e
commit d29f221a3b
8 changed files with 40 additions and 36 deletions
+4 -2
View File
@@ -3,7 +3,9 @@ import axios from "axios";
import { Dispatch, RefObject, SetStateAction } from "react";
export function makeAddress(ip: string, defaultPort = 7080) {
return ip.includes(":") ? `${ip}` : `${ip}:${defaultPort}`;
// return ip.includes(":") ? `${ip}` : `${ip}:${defaultPort}`;
// Apparently wss doesn't like ports (or maybe the tunnel I'm using)
return ip;
}
export default async function auth(
@@ -19,7 +21,7 @@ export default async function auth(
).token;
// Open the WebSocket connection
const ws = new WebSocket(`ws://${ip}`);
const ws = new WebSocket(`wss://${ip}`);
wsRef.current = ws;
ws.onopen = () => {