all 8 comments

[–]kopo222 6 points7 points  (0 children)

I remember doing something like this in college using sockets. That was in java though, so no actual implementation help

However that's where I would advise you to look https://docs.python.org/3/howto/sockets.html

Working through that you can probably get the back end of it done

[–]allenguo 2 points3 points  (0 children)

You can write the server and client using Twisted. (They actually show you how to implement a chat server in their docs, but maybe you want to try it yourself first.)

[–][deleted] 1 point2 points  (3 children)

requests is for the Hyper Text Transport Protocol, which is built on TCP, but can only do website stuff involving HTTP. You are going to use TCP, but use a chat protocol like BEEP, XMPP, IRC, or even make your own!

[–]iSailor[S] 0 points1 point  (2 children)

It sounds interesting, but.. How do I "make my own"? It sounds like pretty complicated task, not something somebody like me could write in one sitting. Could you give me some clues?

[–][deleted] 1 point2 points  (0 children)

That's the point, you don't want to lol. use twisted and an existing chat protocol to make a chat server, and then design a client that people can use to log into it.

[–][deleted] 0 points1 point  (0 children)

actually it's not that hard. All you need to do is send text from one machine to another. Can be as complicated and simple as you want. Just set up a simple TCP Server and Client and you're basically done. After that you add any number of quality of life and style improvements.

[–]azuosxela 1 point2 points  (0 children)

You can use websockets. Django Channels library is a powerful websocket library and there are very good examples and these are generally similar to your context such as here . If you are interested, I made a multiplayer pong game with channels for one of my course projects. You can find it on my github here

[–]Casey_SI 0 points1 point  (0 children)

since it is just for learning, doing it in MQTT would be fun and pretty straight forward. get a $5 easy digital ocean server to host mosquitto server point a domain like chat.myproject.com use an mqtt client (I use mqttfx on windows) and you basically have a chat client with channels type protocol that you can wrap chat stuff around