Is it possible to use socket.io with twisted.web?

I am writing a web application using Python twisted.web on the server side.

On the interface side, I would like to use Ajax to display real-time updates of events happening on the server.

There are lots of information on how to do this, so I realized that I need to choose a javascript library that would make my life easier.

socket.io seems like a good choice, since it supports several browsers and transport mechanisms, but, reading their examples, it seems that it can only work with node.js ?

So does anyone know if socket.io can be used with twisted.web ? If so, any links for a good example / tutorial would also be welcome.

+4
source share
2 answers

You need the server side to integrate with the socket.io script on the client side. The servers that I know are written in Python and all of this use Tornado. You can look at the implementation of, for example, Tornadio ( https://github.com/MrJoes/tornadio ) and see what methods and classes they used to connect Tornadio and Tornado together. This will give you a pretty good idea of โ€‹โ€‹how to integrate it with your twisted.web server.

We just abandoned socket.io to sockJS (which is also compatible with Tornado) and made big performance improvements,

+2
source

You can try https://github.com/DesertBus/sockjs-twisted , or if you need SocketIO for a certain reason, the TornadIO2 port in Cyclone will not be difficult. You may find this problem interesting.

+3
source

Source: https://habr.com/ru/post/1412764/


All Articles