Python socket.io server implementation on top of Tornado framework

Related tags

WebSocket tornadio2
Overview

TornadIO2

Disclaimer

Unfortunately, Socket.IO 0.8 branch is abandoned, there are huge amount of bugs and nothing getting fixed. I would suggest to look at alternative options, for example SockJS <http://github.com/sockjs/>. There's sockjs-tornado <http://github.com/mrjoes/sockjs-tornado/> too. I don't plan to support TornadIO2 anymore, assuming that parent library is no longer maintained.

If you still want to try Socket.IO 0.8.x with Python, TornadIO2 is quite stable and used in production.

Contributors

Introduction

This is python server implementation of the Socket.IO realtime transport library on top of the Tornado framework.

TornadIO2 is compatible with 0.7+ version of the Socket.IO and implements most of the features found in original Socket.IO server software.

Key features:

  • Supports Socket.IO 0.8 protocol and related features
  • Full unicode support
  • Support for generator-based asynchronous code (tornado.gen API)
  • Statistics capture (packets per second, etc)

What is Socket.IO?

Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It's care-free realtime 100% in JavaScript.

You can use it to build push service, games, etc. Socket.IO will adapt to the clients browser and will use most effective transport protocol available.

Getting Started

In order to start working with the TornadIO2 library, you have to have some basic Tornado knowledge. If you don't know how to use it, please read Tornado tutorial, which can be found here.

If you're familiar with Tornado, do following to add support for Socket.IO to your application:

  1. Derive from tornadio2.SocketConnection class and override on_message method (on_open/on_close are optional):

    class MyConnection(tornadio2.SocketConnection):
        def on_message(self, message):
            pass
    
  2. Create TornadIO2 server for your connection:

    MyRouter = tornadio2.TornadioRouter(MyConnection)
    
  3. Add your handler routes to the Tornado application:

    application = tornado.web.Application(
        MyRouter.urls,
        socket_io_port = 8000)
    
  4. Start your application

  5. You have your socket.io server running at port 8000. Simple, right?

Starting Up

We provide customized version (shamelessly borrowed from the SocketTornad.IO library) of the HttpServer, which simplifies start of your TornadIO server.

To start it, do following (assuming you created application object before):

if __name__ == "__main__":
    socketio_server = SocketServer(application)

SocketServer will automatically start Flash policy server, if required.

If you don't want to start IOLoop immediately, pass auto_start = False as one of the constructor options and then manually start IOLoop.

More information

For more information, check TornadIO2 documentation and sample applications.

Examples

Acknowledgment

Ping sample which shows how to use events to work in request-response mode. It is in the examples/ackping directory.

Cross site

Chat sample which demonstrates how cross-site communication works (chat server is running on port 8002, while HTTP server runs on port 8001). It is in the examples/crosssite directory.

Events and generator-based async API

Example which shows how to use events and generator-based API to work with asynchronous code. It is in the examples/gen directory.

Multiplexed

Ping and chat demo running through one connection. You can see it in examples/multiplexed directory.

Stats

TornadIO2 collects some counters that you can use to troubleshoot your application performance. Example in examples/stats directory gives an idea how you can use these stats to plot realtime graph.

RPC ping

Ping which works through socket.io events. It is in the examples/rpcping directory.

Transports

Simple ping/pong example with chat-like interface with selectable transports. It is in the examples/transports directory.

Comments
  • @event decorator limitation?

    @event decorator limitation?

    I have a set of classes like this:

    class DistributeHandler(SocketConnection): @event def join(self, _args, *_kargs): # Join a channel based on kargs print "Joining %s" % (kargs['group'], )

    on_message(self, msg):
        pass
    

    class MainRouter(SocketConnection): endpoints : { '/realtime': DistributeHandler, '/other': OtherHandler} on_open(self, *args): print "Connected"

    On the client side, I have this: var socket = io.connect("ws://mysite.com/realtime"); socket.emit('join', {group: 5}, function() { console.log('joined'); });

    However, the server informs me that 'join' is an invalid event. Is this because the @event decorator is on the endpoint SocketConnection class and not on the MainRouter object? Is @event supposed to be that limited or this a bug? I'd love to be able to put the @event decorator on the endpoint classes, as that would make my system far more flexible. I just wanted to make sure I understood what is going on.

    opened by greg-hellings 16
  • can't get transports demo to work

    can't get transports demo to work

    seems to serve the main page OK, as well as socket.io.js. when I click "connect" though, it logs "connecting" but doesn't get any further. same in firefox & chromium.

    in the server logs, I see:

    2011-11-07 16:35:44,642 INFO:Starting up tornadio server on port '8001'                                       
    2011-11-07 16:35:44,643 INFO:Starting Flash policy server on port '843'                                       
    2011-11-07 16:35:44,643 INFO:Entering IOLoop...                                                               
    2011-11-07 16:36:29,634 INFO:200 GET / (192.168.0.181) 4.91ms                                                 
    2011-11-07 16:36:29,729 INFO:200 GET /socket.io.js (192.168.0.181) 21.00ms
    

    On the client-side, if I open up the firebug console, I see it tries to make a bunch of ajax GET requests to, eg:

    http://localhost:8001/socket.io/1/?t=1320683800628
    

    but it doesn't receive a response.

    enabling & disabling the various different transport types doesn't seem to make a difference

    python 2.6 on debian, FF 7.0.1, Chromium 14.0.835.202 (Developer Build 103287 Linux)

    I realise it's early days! any ideas what might be going wrong?

    opened by hjwp 9
  • Endpoints dont get info.arguments

    Endpoints dont get info.arguments

    Прежде всего спасибо за вашу работу.

    Я не уверен, что это баг, но мне такое поведение кажется странным.

    Если определены SockectConenction вида:

    class ChatConnection(SocketConnection):
        def on_open(self, info):
            self.send('Chat open connection')
            self.send(info.arguments)
    
    
    class RouterConnection(SocketConnection):
        def on_open(self, info):
            self.send('Router open connection')
            self.send(info.arguments)
    
        __endpoints__ = {'/chat': ChatConnection,
                        '/ping': PingConnection}
    

    и осуществляется подключение с аргументами

        var chat = new io.connect('http://localhost:8001/chat?test=chat');
    

    То при подключении к chat каналу , сначала создается объект типа RouterConnection и вызывается его метод on_open (здесь query аргументы от сервера приходят), потом создается объект ChatConnection и вызывается его метод on_open, но здесь уже не приходят аргументы от сервера.

    Вопрос: Так и должно быть? Я ожидал что при подключении на localhost/chat будет создан только подключение ChatConnection и до него должны дойти аргументы запроса (request.arguments).

    opened by klen 9
  • Safari wss Invalid certificate chain

    Safari wss Invalid certificate chain

    For example whe have:

    • example.com <- simple site with socket.io
    • example.com:8080 <- tornadio2 with ssl mode

    In Safari when js connect to the server on host wss://example.com:8080/socket.io/1/websocket/121a6ae3852addac4c159379a585a27a that return error "WebSocket network error: OSStatus Error -9807: Invalid certificate chain"

    but in Chrom, Firefox working correctly.

    My server config: Nginx

    nginx version: nginx/1.3.6
    TLS SNI support enabled
    configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.3.6/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.3.6/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.3.6/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.3.6/debian/modules/nginx-dav-ext-module
    

    example.com

    server {
        listen 80;
        server_name example.com www.example.com;
    
        rewrite ^(.*)$ https://example.com$1 permanent;
    }
    
    server {
        listen 443 ssl;
    
        server_name example.com www.example.com;
    
        ssl on;
        ssl_certificate /etc/nginx/ssl/server.crt;
        ssl_certificate_key /etc/nginx/ssl/server.key;
    
        access_log /var/log/nginx/example.access.log;
        error_log /var/log/nginx/example.error.log;
    
        root  /var/www/example/htdocs/;
        expires +1M;
    
        location / {
                include uwsgi_params;
                uwsgi_pass unix:///run/uwsgi/app/example/socket;
        }
    
        location /websocket_status {
            check_status;
        }
    
    }
    
    

    example.com:8080

    upstream cluster {
        server 127.0.0.1:8001;
    
        check interval=3000 rise=2 fall=5 timeout=1000;
    }
    
    server {
        listen 8080;
    
        ssl on;
        ssl_certificate /etc/nginx/ssl/server.crt;
        ssl_certificate_key /etc/nginx/ssl/server.key;
    
        proxy_pass cluster;
    }
    
    

    Thanks.

    opened by suquant 8
  • Documentation on Session usage

    Documentation on Session usage

    From what I can tell, the current documentation is a little scant on how to properly implement session handling from within a router. The structure of the code makes it a little difficult to understand how sessions are instantiated.

    The chat included with the codebase gives a detailed explanation of how to persist multiple users on a singleton connection object, but does go into detail about persisting sessions or creating channels. A practical howto would be great.

    opened by DeaconDesperado 6
  • PyPi

    PyPi

    Please upgrade PyPi repositories for package "tornadio2"

    When i install "pip install tornadio2" that installed old version package without some fixed bugs :( its very discomfortable, also when i install from github repositories from master "-e git+git://github.com/mrjoes/tornadio2/#egg=TornadIO2" its not working correctly, because TornadIO2-0.0.3-py2.7.egg-info has incorrect link to source for examle that included "../tornadio2/" but source installed in venv/src/tornadio2/tornadio2/...

    Do you know why pip do that? It is correctly behavior for pip ?

    opened by suquant 6
  • Multiple connects to same endpoint result in connection leakage

    Multiple connects to same endpoint result in connection leakage

    In the course of writing my own socket.io client, I discovered that a "misbehaving" client that connects to the same endpoint more than once causes any existing connection to that endpoint to never be disconnected in the server (this may be specific to the multiplexed example as it keeps an internal reference to connection and may be interacting poorly with expected garbage collection behavior).

    My fix was this:

    diff --git a/tornadio2/session.py b/tornadio2/session.py
    index c55b5c7..48aadc9 100644
    --- a/tornadio2/session.py
    +++ b/tornadio2/session.py
    @@ -296,6 +296,9 @@ class Session(sessioncontainer.SessionBase):
                 return
    
             conn = conn_class(self, endpoint)
    +        old_conn = self.endpoints.get(endpoint, None)
    +        if old_conn is not None:
    +            self.disconnect_endpoint(endpoint)
             self.endpoints[endpoint] = conn
    
             self.send_message(proto.connect(endpoint))
    

    Any thoughts on what the proper fix should be?

    opened by cpisto 6
  • uncaught exception breaks connection - poss due to heartbeat breaking chatty connection?

    uncaught exception breaks connection - poss due to heartbeat breaking chatty connection?

    Hey,

    we've noticed several Uncaught exception in /socket.io/1/websocket/ types of errors in our logs. We think it tends to happen when there's a lot of small bits data being transmitted between the client and server in quick succession.

    We find that, with every error, an incoming message is received at the same time as a heartbeat... so it looks like that's probably what's causing the issue?

    Here's a minimal repro, which should crash within a minute or so... :

    
    from os import path as op
    import logging
    from tornado import web
    from tornadio2 import SocketConnection, TornadioRouter, SocketServer
    ROOT = op.normpath(op.dirname(__file__))
    
    class IndexHandler(web.RequestHandler):
        """Regular HTTP handler to serve the ping page"""
        def get(self):
            self.render('index.html')
    
    class SocketIOHandler(web.RequestHandler):
        def get(self):
            self.render('../socket.io.js')
    
    class PongConnection(SocketConnection):
        def on_message(self, message):
            print message
            self.send('pong')
    
    PingRouter = TornadioRouter(PongConnection,
                                dict(enabled_protocols=['websocket', 'xhr-polling',
                                                        'jsonp-polling', 'htmlfile']))
    application = web.Application(
        PingRouter.apply_routes([
            (r"/", IndexHandler),
            (r"/socket.io.js", SocketIOHandler)
        ]),
        flash_policy_port = 843,
        flash_policy_file = op.join(ROOT, 'flashpolicy.xml'),
        socket_io_port = 8001
    )
    
    if __name__ == "__main__":
        # watch logs for error
        logging.basicConfig(filename='repro.log', level=logging.DEBUG, format='%(asctime)s %(levelname)s:%(message)s')
        SocketServer(application)
    
    <!DOCTYPE html>
    <html>
    <head>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
      <script src="socket.io.js"></script>
      <script>
        $(function() {
            var socketio = new io.connect('http://' + window.location.host);
    
            socketio.on('disconnect', function() {
                console.log('disconnected');
            });
            socketio.on('error', function() {
                console.log('error');
            });
    
            socketio.on('connect', function() {
              console.log('connected');
              for (var i=0; i< 100000; i++){
                socketio.send('ping' + i);
              }
            });
        });
    </script>
    </head>
    <body><h3>Minimal repro</h3></body>
    </html>
    

    and here is what we find in the logs -- the <<<3 is a normal socketio message, and if we understand it correctly, the <<<2 is a heartbeat.

    2012-03-07 15:49:22,313 DEBUG:>>> 3:::ping10717
    2012-03-07 15:49:22,314 DEBUG:<<< 3:::pong
    2012-03-07 15:49:22,317 DEBUG:>>> 3:::ping10718
    2012-03-07 15:49:22,317 DEBUG:<<< 3:::pong
    2012-03-07 15:49:22,323 DEBUG:>>> 3:::ping10719
    2012-03-07 15:49:22,324 DEBUG:<<< 3:::pong
    2012-03-07 15:49:22,326 DEBUG:<<< 2::
    2012-03-07 15:49:22,326 DEBUG:<<< 0::
    2012-03-07 15:49:22,327 ERROR:Uncaught exception in /socket.io/1/websocket/9292bc6ecf30cab96d548ae0b87e4e18
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 254, in wrapper
        return callback(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/tornadio2/persistent.py", line 136, in on_message
        self.session.close()
    AttributeError: 'NoneType' object has no attribute 'close'
    
    opened by hjwp 6
  • tornadio cluster behind a load balancer

    tornadio cluster behind a load balancer

    Hi I am trying to set up a cluster of tornado servers behind a load balancer and noticed that SessionContainer is just a dict. This means I MUST send clients to the same server every request. Maybe you already thought about this? What I want to do is implement a memcached session backend so it doesn't matter on which server you end up for each request.

    Or maybe you've got some other ideas?

    opened by specialunderwear 5
  • python client for tornadio2

    python client for tornadio2

    hey, this is more a feature request than an issue, but is it possible to include a python client to interact with the server? there are use cases where we need to to push some data to tornadio server programmatically and a python client woud come handy. other use cases been testing, load testing, etc.

    i tried the code hosted here: http://pypi.python.org/pypi/websocket-client/0.5.0a, but i don't think it handles the handshaking protocol implemented in tornadio2.

    thx.

    opened by the1plummie 5
  • ERROR - Error in periodic callback

    ERROR - Error in periodic callback

    I have some problems running tornadio2 in production. I get "Error in periodic callback".

    Any ideas what the problem could be?

    Many thanks for any hint!

    Traceback (most recent call last): File "build/bdist.freebsd-9.1-RELEASE-amd64/egg/tornadio2/periodic.py", line 82, in _run next_call = self.callback() File "build/bdist.freebsd-9.1-RELEASE-amd64/egg/tornadio2/session.py", line 274, in _heartbeat self.send_message(proto.heartbeat()) File "build/bdist.freebsd-9.1-RELEASE-amd64/egg/tornadio2/session.py", line 192, in send_message self.flush() File "build/bdist.freebsd-9.1-RELEASE-amd64/egg/tornadio2/session.py", line 202, in flush self.handler.send_messages(self.send_queue) File "build/bdist.freebsd-9.1-RELEASE-amd64/egg/tornadio2/persistent.py", line 160, in send_messages self.write_message(m) File "lib/python2.7/site-packages/tornado-3.0.1-py2.7.egg/tornado/websocket.py", line 164, in write_message self.ws_connection.write_message(message, binary=binary) AttributeError: 'NoneType' object has no attribute 'write_message'

    opened by chirimoya 4
  • Proposing a PR to fix a few small typos

    Proposing a PR to fix a few small typos

    Issue Type

    [x] Bug (Typo)

    Steps to Replicate and Expected Behaviour

    • Examine tornadio2/persistent.py, tornadio2/session.py and observe hearbeat, however expect to see heartbeat.
    • Examine doc/deployment.rst and observe writting, however expect to see writing.
    • Examine examples/socket.io.js and observe trigged, however expect to see triggered.
    • Examine examples/socket.io.js and observe publci, however expect to see public.
    • Examine doc/bugs.rst and observe parametes, however expect to see parameters.
    • Examine tornadio2/polling.py and observe hearbeats, however expect to see heartbeats.
    • Examine examples/socket.io.js and observe corss, however expect to see cross.
    • Examine examples/socket.io.js and observe costructor, however expect to see constructor.

    Notes

    Semi-automated issue generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    To avoid wasting CI processing resources a branch with the fix has been prepared but a pull request has not yet been created. A pull request fixing the issue can be prepared from the link below, feel free to create it or request @timgates42 create the PR. Alternatively if the fix is undesired please close the issue with a small comment about the reasoning.

    https://github.com/timgates42/tornadio2/pull/new/bugfix_typos

    Thanks.

    opened by timgates42 0
  • in the circus, tornadio2 occur error

    in the circus, tornadio2 occur error

    Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/tornado/websocket.py", line 494, in _run_callback result = callback(*args, **kwargs) File "/usr/local/lib/python3.4/dist-packages/TornadIO2-0.0.3-py3.4.egg/tornadio2/persistent.py", line 91, in open raise HTTPError(401, "Invalid Session") tornado.web.HTTPError: HTTP 401: Unauthorized (Invalid Session)

    opened by zhangjianpinghik 0
  • Python 3.5.2 Error

    Python 3.5.2 Error

    SyntaxError: invalid syntax Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.5/site-packages/circusweb/circushttpd.py", line 25, in import tornadio2 File "/usr/local/lib/python3.5/site-packages/tornadio2/init.py", line 25, in from tornadio2.router import TornadioRouter File "/usr/local/lib/python3.5/site-packages/tornadio2/router.py", line 27, in from tornadio2 import persistent, polling, sessioncontainer, session, proto, preflight, stats File "/usr/local/lib/python3.5/site-packages/tornadio2/persistent.py", line 143 except Exception, ex:

    opened by SmithSamuelM 0
  • Include tests in tarball and report failing testsuite

    Include tests in tarball and report failing testsuite

    Is tornadio2 compatible with tornado > 3? Over here I just got these failures:

    ======================================================================
    ERROR: tests.gen_test.test
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "./tornadio2/tests/gen_test.py", line 103, in test
        dummy.test('test')
      File "./tornadio2/tornadio2/gen.py", line 113, in wrapper
        run(args, kwargs)
      File "./tornadio2/tornadio2/gen.py", line 84, in run
        data.runner = SyncRunner(gen, finished)
      File "./tornadio2/tornadio2/gen.py", line 45, in __init__
        super(SyncRunner, self).__init__(gen)
    TypeError: __init__() takes exactly 3 arguments (2 given)
    
    ======================================================================
    ERROR: tests.gen_test.test_async
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "./tornadio2/tests/gen_test.py", line 112, in test_async
        dummy.test('test')
      File "./tornadio2/tornadio2/gen.py", line 113, in wrapper
        run(args, kwargs)
      File "./tornadio2/tornadio2/gen.py", line 84, in run
        data.runner = SyncRunner(gen, finished)
      File "./tornadio2/tornadio2/gen.py", line 45, in __init__
        super(SyncRunner, self).__init__(gen)
    TypeError: __init__() takes exactly 3 arguments (2 given)
    
    ======================================================================
    ERROR: tests.gen_test.test_sync_queue
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "./tornadio2/tests/gen_test.py", line 123, in test_sync_queue
        dummy.test('1')
      File "./tornadio2/tornadio2/gen.py", line 113, in wrapper
        run(args, kwargs)
      File "./tornadio2/tornadio2/gen.py", line 84, in run
        data.runner = SyncRunner(gen, finished)
      File "./tornadio2/tornadio2/gen.py", line 45, in __init__
        super(SyncRunner, self).__init__(gen)
    TypeError: __init__() takes exactly 3 arguments (2 given)
    
    ======================================================================
    ERROR: tests.gen_test.test_sync_queue_oor
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "./tornadio2/tests/gen_test.py", line 136, in test_sync_queue_oor
        dummy.test('1')
      File "./tornadio2/tornadio2/gen.py", line 113, in wrapper
        run(args, kwargs)
      File "./tornadio2/tornadio2/gen.py", line 84, in run
        data.runner = SyncRunner(gen, finished)
      File "./tornadio2/tornadio2/gen.py", line 45, in __init__
        super(SyncRunner, self).__init__(gen)
    TypeError: __init__() takes exactly 3 arguments (2 given)
    
    ======================================================================
    FAIL: tests.session_test.test_endpoint
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "./tornadio2/tests/session_test.py", line 247, in test_endpoint
        eq_(conn_test.request.arguments, dict(a=['123'], b=['456']))
    AssertionError: {} != {'a': ['123'], 'b': ['456']}
    -------------------- >> begin captured logging << --------------------
    tornadio2.session: DEBUG: <<< 1::
    tornadio2.session: DEBUG: >>> 1::/test?a=123&b=456
    tornadio2.session: DEBUG: <<< 1::/test
    --------------------- >> end captured logging << ---------------------
    
    ----------------------------------------------------------------------
    Ran 17 tests in 0.063s
    
    FAILED (errors=4, failures=1)
    
    opened by tomspur 0
  • Python 3 compatibility

    Python 3 compatibility

    This fixes issue #48. It was surprisingly straightforward.

    A few things of note: 0. The aim was to have a single codebase that's compatible with both major versions.

    1. It takes advantage of the py3 syntax backports into 2.6 and 2.7 as well as the reintroduced u'string' literals in 3.3. As such, the code is not compatible with 2.5, 3.1 and 3.2. If that's alright with the community, I'd like to keep it that way because it makes it much easier to maintain. If it is a problem, we should come up with a consensus on the supported versions and I shall attempt to update this.
    2. I didn't get to port the tests yet. That's to come next week if there's an interest the port. I have updated and tested the examples, though, and they work.
    3. Related to that, the "gen" and "ssl_transports" examples didn't work for me out of the box on master so I don't test them on the python3 branch either. I'll look into it next week to see if there are genuine bugs or it's just an issue with my setup.

    I tried to follow Armin Ronacher's suggestions: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/

    Please do try it out and let me know if you have any issues or concerns over the code.

    opened by tomassedovic 0
Owner
Serge S. Koval
Serge S. Koval
Socket.IO integration for Flask applications.

Flask-SocketIO Socket.IO integration for Flask applications. Installation You can install this package as usual with pip: pip install flask-socketio

Miguel Grinberg 4.9k Jan 3, 2023
WebSocket implementation in Python built on top of websockets python library. Similar to Node.js's ws.

ws WebSocket implementation in Python built on top of websockets python library. Similar to Node.js's ws. Basic usage. server.py import ws server = w

AceExpert 7 Jun 27, 2022
Websockify is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service. Implementations in Python, C, Node.js and Ruby.

websockify: WebSockets support for any application/server websockify was formerly named wsproxy and was part of the noVNC project. At the most basic l

noVNC 3.3k Jan 3, 2023
WebSocket emulation - Python server

SockJS-tornado server SockJS-tornado is a Python server side counterpart of SockJS-client browser library running on top of Tornado framework. Simplif

Serge S. Koval 854 Nov 19, 2022
Django Channels HTTP/WebSocket server

daphne Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django Channels. It supports automatic negotia

Django 1.9k Dec 31, 2022
This websocket program is for data transmission between server and client. Data transmission is for Federated Learning in Edge computing environment.

websocket-for-data-transmission This websocket program is for data transmission between server and client. Data transmission is for Federated Learning

null 9 Jul 19, 2022
tiny multi-threaded socks4 server implemented in python2

tiny, multi-threaded socks4a server implemented in python2.

null 4 Sep 21, 2022
Benchmark a WebSocket server's message throughput ⌛

?? WebSocket Benchmarker ⌚ Message throughput is how fast a WebSocket server can parse and respond to a message. Some people consider this to be a goo

Andrew Healey 24 Nov 17, 2022
image stream publish server over websocket

Image Stream Push Server 简介 通过浏览器网页实时查看图像处理结果。 环境 运行程序需要安装一下python依赖: tornado: 用于创建http及websocket服务; opencv-contrib-python: 用于图像数据源获取及图像处理。 使用 进入到src目

MrError404 1 Nov 4, 2021
Synci - Learning project to create a websocket based client server messaging application

Synci Learning project to create a websocket based client server messaging appli

null 2 Jan 13, 2022
WebSocket and WAMP in Python for Twisted and asyncio

Autobahn|Python WebSocket & WAMP for Python on Twisted and asyncio. Quick Links: Source Code - Documentation - WebSocket Examples - WAMP Examples Comm

Crossbar.io 2.4k Jan 4, 2023
Library for building WebSocket servers and clients in Python

What is websockets? websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on

Aymeric Augustin 4.3k Jan 4, 2023
WebSocket client for Python

websocket-client The websocket-client module is a WebSocket client for Python. It provides access to low level APIs for WebSockets. All APIs are for s

null 3.1k Jan 2, 2023
一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK

Nakuru Project 一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK 在 kuriyama 的基础上改动 项目名来源于藍月なくる,图标由せら绘制 食用方法 将 nakuru 文件夹移至 Python 的 Lib/site-packages 目录下。

null 35 Dec 21, 2022
Using python-binance to provide websocket data to freqtrade

The goal of this project is to provide an alternative way to get realtime data from Binance and use it in freqtrade despite the exchange used. It also uses talipp for computing

null 58 Jan 1, 2023
alien.py - Python interface to websocket endpoint of ALICE Grid Services

alien.py - Python interface to websocket endpoint of ALICE Grid Services Quick containerized testing: singularity

Adrian Sevcenco 6 Dec 14, 2022
a socket mock framework - for all kinds of socket animals, web-clients included

mocket /mɔˈkɛt/ A socket mock framework for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support ...and then MicroPytho

Giorgio Salluzzo 249 Dec 14, 2022
a socket mock framework - for all kinds of socket animals, web-clients included

mocket /mɔˈkɛt/ A socket mock framework for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support ...and then MicroPytho

Giorgio Salluzzo 249 Dec 14, 2022
a socket mock framework - for all kinds of socket animals, web-clients included

mocket /mɔˈkɛt/ A socket mock framework for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support ...and then MicroPytho

Giorgio Salluzzo 208 Jan 31, 2021