Advice: Socket.IO Client in Python

1,265 views
Skip to first unread message

deakblue

unread,
Oct 12, 2011, 4:28:16 PM10/12/11
to Socket.IO

I wanted to get some feedback before writing (attempting) a Socket.IO
client in Python.

As I understand it, Socket.IO is considerably larger than merely
websockets with transport fallback. The web client can connect to
channels and rooms, receive broadcasts, the whole event system...
there's a pretty elaborate Socket.IO messaging protocol (which also
makes me wonder where it fits into the world of Stomp, AMQP, etc) and
event api.

All of these things are good in the browser, they're also good in
other kinds of clients, particularly if one wanted to consolidate
communications to one messaging server, serving browsers and python
desktop clients alike for example.

So I'm interested in whether this line of thinking is valid. Has
anyone gone down this path? Would synchronizing changes to the
javascript and python clients over time be tough to manage? Other
thoughts?

Thanks,
-db-

New2WebSockets

unread,
Oct 17, 2011, 8:44:19 PM10/17/11
to sock...@googlegroups.com

Prior to deciding that Socket.IO was the right way to go I checked out Autobahn ... because it has both Python client and server-side examples.  You might check it out for ideas as it has a lot of good things going for it.


Also, while doing research I came across this sweet review of Python WSGI servers:


I've been doing non-websocket Python work in CherryPy and really like how clean and easy it is.  CherryPy also seemed to hold up well in the WSGI benchmark.  I hope to find, create, or contribute to a CherryPy example that works with the Socket.IO java script client.

It would be awesome to get Python and other language samples in the "How To Use"section at http://socket.io/ or in the "Articles and Recipes" section at: https://github.com/learnboost/socket.io/wiki/

ja...@stream-rnd.com

unread,
Oct 17, 2011, 7:17:49 PM10/17/11
to Socket.IO
Ditto on that question.

It seems like Socket.IO is most certainly the way to go client-side
but I'm trying to avoid re-inventing the wheel on the server-side in
Python. I've been using CherryPy and hope that I can get it working
with Socket.IO because it is so clean and easy to work with.

I did some searching and found this awesome article on websockets and
Python:

http://nichol.as/benchmark-of-python-web-servers

I also checked out Autobahn and I really liked how the client-side
code is bundled with a server-side examples (Python, Android)

http://www.tavendo.de/autobahn/tutorials.html

It would be awesome to add python examples to the mix up at
http://socket.io/#how-to-use

Will Heger

unread,
Oct 18, 2011, 3:41:52 AM10/18/11
to sock...@googlegroups.com
On first glance, Autobahn is actually a better fit for my needs -- I
need to target browser, desktop, and Android clients. Downside, I
need to restrict browser targets to HTML5 and my server's already in
node.js (easily changed).

I'm starting to play with the java-socket.io client
(https://github.com/benkay/java-socket.io.client). I'll probably try
to model a python client around it and in the meantime it should give
me something on Android.

I don't actually need screaming performance, but I want to consolidate
to one communication system. It's interesting that for example, with
a python socket.io server and a java socket.io client, socket.io is
looking more like a standard than an implementation.

Thanks for the references, very eye-opening,
-db-

Reply all
Reply to author
Forward
0 new messages