Posted
so yeah the title is confusing but i didn't know how to say it
this thread is partly C# and partly js, but its mainly focused on C# tho
const port = 6969; // 6969;
const serverlistenthingy = http.createServer().listen(port);
const websocket = new web({ httpServer: serverlistenthingy });
websocket.on("request", (request) => {
console.log("a person joined");
});
ok so ^ is my reply code, so if someone connects to the websocket, it would print "a person joined" to the console but it isn't
I've tried this on my localhost and it works
when i use localhost (in my C# app)
WebSocket ws = new WebSocket("ws://localhost:6969");
ws.Connect(); // when i run it shows "a person joined" in the js console
when i use this it works, it prints "a person joined" in the js console
but I've tried on my repl, and it doesn't work:
WebSocket ws = new WebSocket("ws://myrepl.repluser.repl.co:6969");
ws.Connect(); // when i run this in the C# app nothing shows in js console
ignore the "myrepl.repluser" thingy i just don't wanna let ppl know my repl bc no
OK IM RETARDED I FOUND OUT THE REASON
its supposed to be starting with wss:// instead of ws://
WebSocket ws = new WebSocket("wss://myrepl.repluser.repl.co:6969");
ws.Connect(); // this works nowReplied
Jesus christ
Cancel
Post
Discord : Doctor Doom#0550
Replied
https / wss bro
Cancel
Post
Replied
@MaximusExploit i put it on https and http and everything i could think of and it still didn't work, wss was the only one that worked
Cancel
Post
Replied
@MaximusExploit wat dafuq, https and http didnt even work, only wss did that makes no sense
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post