Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a server Python 3 websocket module?

I spend a few days trying to implement a simple server to exchange messages with a browser but it doesn't work(the browser is supposed to be the GUI for my python program).

I looked around and couldn't find any already built module I can use. Either are the modules for Python 2 or else they are too complex. I want a single .py file which I can use to read and send websocket messages with/to the browser.

Does something like that exist?

like image 253
Pithikos Avatar asked Jul 02 '13 15:07

Pithikos


2 Answers

It turns out there's a 3.3+ websockets using asyncio found here

like image 77
Foo Bar User Avatar answered Oct 05 '22 06:10

Foo Bar User


It might not meet your simplicity measure, but the websocket.py file inside websockify supports python 2.x and 3.x in the same code-base.

The echo example that uses it is pretty simple.

like image 26
kanaka Avatar answered Oct 05 '22 08:10

kanaka