Sockjs and tornado: How Sent and Read Data

340 views Asked by At

I’m trying to learn sockjs for a small university project.

I’ve a local server (with typical LAMP configuration), my goal is writing a python script (running on my local server) that is able to send data to client browser in order to update a text information.

Sockjs was seemed to me the best solution (tornado-sockjs for python server). I read the tutorial examples (https://github.com/mrjoes/sockjs-tornado/tree/master/examples) but I’ve difficult to understand the basic functions.

It would be very useful to understand an example code. An example could be:

A python-server script generates a random number each 5 seconds and send this number to client. In webpage there is a definite element to update this value. In the same webpage there is a button to send a text message to python server. When python server received this message, print it in the server console.

Thank you in advance for your help.

I hope that this post will be useful to other people.

0

There are 0 answers