I am trying to set up a python server on cloud 9 that listens for incoming connections and responds with various messages when it receives data. I would like to be able to use net cat on mac to connect to and communicate with the server using something like the following code:
nc 184.108.40.206 8888
This line should connect with the server and be able to send and receive messages. I have tried using socket for python on port 8080 and have been able to connect locally but not externally.
In summary, I’m looking for a snippet of code that will create a server which can push messages to clients when they connect and also react to messages that it receives from clients, and I would like to use net cat to interface with the server