socket default acess refuse server

This commit is contained in:
NigeParis 2025-11-18 14:22:33 +01:00 committed by Maix0
parent cf6f3145b6
commit 34e9f8e3ca
3 changed files with 17 additions and 39 deletions

View file

@ -3,12 +3,19 @@ import { showError } from "@app/toast";
import authHtml from './chat.html?raw';
import client from '@app/api'
import { updateUser } from "@app/auth";
import io from "socket.io-client"
const socket = io("https://localhost:8888");
// const socket = io("wss://localhost:8888");
const socket = io("wss://localhost:8888", {
path: "/app/chat/socket.io/",
secure: false,
transports: ["websocket"],
});
// Listen for the 'connect' event
socket.on("connect", async() => {
socket.on("connect", () => {
console.log("Connected to the server: ", socket.id);
// Send a message to the server
socket.send("Hello from the client: " + `${socket.id}`);