Abhi
Abhi

Reputation: 115

Websocket library for python

Hi I need a websocket server in python which supports the protocol used in chrome 16(protocol version 13). Tornado and twisted are not working. Websockify works but i can't find any documentation for it. I need minimal setup means lesser imports. Please help me out here thanks in advance.

Upvotes: 8

Views: 4900

Answers (5)

kanaka
kanaka

Reputation: 73119

If you are still interested in using websockify, there is a simple example of using it to build an echo server included](https://github.com/kanaka/websockify/blob/master/tests/echo.py).

You can run it like this (from a websockify checkout):

./tests/echo.py 8080

The browse to localhost:8080/tests/echo.html. Enter localhost, 8080 for the WebSocket host and port and hit connect. You should see the client sending messages and the server echoing them back (with a "You said: " prefix).

Upvotes: 0

GDICommander
GDICommander

Reputation: 1333

This page contains an implementation of a Python websocket server that can be used through imports:

https://github.com/AdrianGaudebert/python-websocket-server

You should know that the license for using this is MIT. It may only work with Python 3.0.

Upvotes: 0

GDICommander
GDICommander

Reputation: 1333

Here are some examples of implementing a websocket server in Python. Be sure to read and apply the comments on the code of the following examples, because there may be some bugs:

Upvotes: 0

Cédric Julien
Cédric Julien

Reputation: 80761

  • Maybe you could take a look to pywebsocket, it claims to support protocol version 13 and is designed for :

    The pywebsocket project aims to provide a WebSocket standalone server and a WebSocket extension for Apache HTTP Server, mod_pywebsocket.

  • Autobahn is another implementation of websockets :

    Autobahn WebSockets for Python provides an implementation of the WebSockets protocol which can be used to build WebSockets clients and servers

  • ws4py : Websocket for python :

    Python library providing support for the WebSocket protocol defined in RFC 6455

Upvotes: 5

Related Questions