Ask coding questions

← Back to all posts
How do Ports Work in repl?
h
realTronsi (906)

How do ports work in repl? The other day I tried forking one of my applications into repl for some testing purposes, but ports don't seem to work the same way.

const ws = new Websocket("wss://domain.com:3000")

Putting something like that wouldn't work, and I'm not sure if repl presets a port or has some other API I'm unaware about.

Comments
hotnewtop
ironblockhd (425)

Replit uses a proxy that forces anything on port 80 and only supports tcp, specify port 80 instead of 3000 in the client side

Coder100 (16989)

Simply put, if your local project had: localhost:8080
In repl.it it becomes: [yourrepl].[yourname].[repl].[co]

If you had: 127.0.0.1:8080, you will need to change the IP to 0.0.0.0: 0.0.0.0:8080

Then: [yourrepl].[yourname].[repl].[co]

realTronsi (906)

@Coder100 So there's no need for a port specification in repl?[yourrepl].[yourname].[repl].[co]