Skip to content
Sign upLog in
← Back to Community

Connection Error

Profile icon
AnshAgarwal1

So, I have 2 repls; one for hosting the server, and one for acting as a client. Click to go to the client repl. When I run the client, it says:

Traceback (most recent call last): File "main.py", line 1, in <module> import client File "/home/runner/Socket-Testing-Client/client.py", line 10, in <module> client.connect(ADDR) ConnectionRefusedError: [Errno 111] Connection refused

How do I fix this?

Answered by EpicGamer007 [earned 5 cycles]
View Answer
Voters
Profile icon
AgusKartina
Profile icon
AnshAgarwal1
Comments
hotnewtop
Profile icon
EpicGamer007

The client had an error connecting, check your client code and server code to make sure connecting to the server repl works properly

Profile icon
AnshAgarwal1

@EpicGamer007
I don't understand what you mean...

Profile icon
EpicGamer007

@AnshAgarwal1
OHHHH i see..

Profile icon
EpicGamer007

@AnshAgarwal1
You cannot have servers in replit, you can only have http servers

Profile icon
EpicGamer007

@AnshAgarwal1
if you want to use a server in python on repl, u need to set up an http server which you then send http requests to, you cannot use a server like this because replit is an online ide and does not support creating normal servers and only supports http servers

Profile icon
AnshAgarwal1
Profile icon
EpicGamer007

@AnshAgarwal1
if it helped u, i would appreciate u marking my answer as correct to show others that this question has been answered

Profile icon
AgusKartina

Tidak bisa terhubung

Profile icon
RYANTADIPARTHI

You are using different servers. Try http servers. You are not connecting to the right server.

Profile icon
Coder100

Connect to the actual socket:

wss://replname.username.repl.co

You probably were taking a tutorial on devving locally xd