Python Socket in Replit
I tried making a socket program, but I can't seem to get my client to connect to the server. I did some research and found another post that suggested changing the host to "0.0.0.0", but now when I run my client code, it gives the following error:
Traceback (most recent call last):
File "main.py", line 11, in
client.connect(ADDR)
ConnectionRefusedError: [Errno 111] Connection refused
My server: https://replit.com/@Illusion705/Socket-Chat-server?v=1
My client: https://replit.com/@Illusion705/Socket-Chat-client?v=1
How do I fix this?
Put the Host on 0.0.0.0 then put the port to like 80 or smtn where replit has it port forwarded automatically
try other editors. Replit doesn't support sockets. But it is available in python
Sockets don't work on repl.it.
You may want to try websockets.
As far as I know, sockets do not work in python on replit, due to the fact that it thinks it supposed to create an HTTP server or something like that. You can however use socket.io in Node.js, if you still want to host it on replit.