I am working on building a chat server using simple sockets. I was wondering if it is possible to use the python socket server library and an amazon ec2 instance to create a basic chat server. Also, if you have any better recommendations please let me know.
You can facilitate server-to-server communication on Amazon EC2 servers using sockets. Depending on how you open the sockets, you may need to configure your EC2 instances to listen for incoming connections on certain ports; see this article for more details on how to modify your server's security settings to allow inbound connections.
As far as alternate recommendations, I would recommend using a real-time network such as PubNub to relay data between your chat clients and the server. Using a real-time network means that you can spend less time worrying about low-level socket issues such as concurrency and more time building your application.
In the case of PubNub, a Python SDK will allow your server to subscribe to chat channels, while the JavaScript SDK may work better for any web-based clients.
Check out this example: Build Real-Time Chat Apps in 10 Lines of Code. I believe this approach would work for your scenario, while allowing your server to subscribe to the same chat channels to log the chat messages.
Let me know if this works for you. Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With