Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
SockJS-tornado server | ||
===================== | ||
|
||
SockJS-tornado is a Python server side counterpart of `SockJS-client browser library <https://github.com/sockjs/sockjs-client>`_ | ||
running on top of `Tornado <http://tornadoweb.org>`_ framework. | ||
|
||
Simplified echo SockJS server could look more or less like:: | ||
|
||
from tornado import web, ioloop | ||
from sockjs.tornado import SockJSRouter, SockJSConnection | ||
|
||
class EchoConnection(SockJSConnection): | ||
def on_message(self, msg): | ||
self.send(msg) | ||
|
||
if __name__ == '__main__': | ||
EchoRouter = SockJSRouter(EchoConnection, '/echo') | ||
|
||
app = web.Application(EchoRouter.urls) | ||
app.listen(9999) | ||
ioloop.IOLoop.instance().start() | ||
|
||
(Take look at `examples <https://github.com/MrJoes/sockjs-tornado/tree/master/examples>`_ for a complete version). | ||
|
||
Subscribe to `SockJS mailing list <https://groups.google.com/forum/#!forum/sockjs>`_) for discussions and support. | ||
|
||
SockJS-tornado API | ||
------------------ | ||
|
||
.. TBD .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters