Skip to content
← Back to Community
How to connect two repls via websockets in PYTHON?
Profile icon
[deleted]

Can someone please give me the two things I have been looking for for over a year?

  1. A WORKING websocket server code example (in python) that other repls can connect to. It can be as simple as returning a number.

  2. A WORKING websocket client code example to recieve the data that would work in repl.

I tried to build a game a while back, but it failed. I would like to rebuild it in real-time mmo, but I need the above to do so.

If you can help, it will be much appreciated!

Comments
hotnewtop
Profile icon
DarthDoofus

@Myriad405 I'm not sure how well two separate repls connect to each other because repls don't have public ip's and the private ip's don't stay the same. I have some school I have to get done tonight but I'll take a crack at it, what kind of thing are you working on? A chat app? A game?

Profile icon
[deleted]

@DarthDoofus Hey, thanks for your interest!
I am working on a game. I built a game a while back called BitGenerals (now taken down) that used databases to technically connect users, but I figure that real-time would be better.

Profile icon
SixBeeps

Do you want to work with raw websockets, or would you mind using a library such as socketio? Also, will your game be a web application or a standalone program?

Profile icon
[deleted]

@SixBeeps Hey there!
I would prefer raw websockets and as a standalone, if possible.

Profile icon
[deleted]

@SixBeeps Are you able to help with that? No pressure.

Profile icon
SixBeeps

@Redhawk405 I've never worked with raw websockets before, but I could give it a stab sometime tonight (EST) if nobody else can help by then.

Profile icon
[deleted]

@SixBeeps OK. Thanks!

Profile icon
[deleted]

@SixBeeps Did you get to it last night?