Ask coding questions

← Back to all posts
wtf is up with repl and websockets
h
realTronsi

using websockets in repl:

I've asked this question before but it never worked

neither works

The server code is such:

Every NodeJS related program coded in other IDEs such as ATOM or VS Code breaks upon forking into repl.

Voters
AndrewJefferso1
DigiLab
realTronsi
Comments
hotnewtop
AndrewJefferso1

this does work for me, at least if I put the websocket on the same port as http, which should be fine: here's an example https://replit.com/@AndrewJefferso1/websocket-example

AndrewJefferso1

this is such a pain

Coder100

iirc just do const ws = new WebSpcket("wss://replname");

realTronsi

@Coder100 ik but that doesn't work on repl idfk why. repl is broken

Coder100
Coder100

http server? @realTronsi

realTronsi

@Coder100 yep, but repl is https so obviously ws:// doesn't work

realTronsi

@Coder100 I feel like this is a bug at this point