Re: [Twisted-Python] Protocol for socket.io

2014-01-29 Thread Laurens Van Houtven
Hi Andrew,


SockJS is a different project from socket.io; it just tries to solve a
similar problem (WebSockets everywhere).

If you literally need socket.io and not a similar thing in the same problem
space, then SockJS will not help you.

You can read about the spec for SockJS here:
https://github.com/sockjs/sockjs-protocol

hth
lvh
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-29 Thread Andrew Francis
Hi Laurens and Folks:

Thanks for all the replies. I'll try desert-sockjs first. Looking through the 
documentation, it is not clear to me how I would handle socket.io events 
(unfortunately I am new to socket.io). There doesn't seem to be an event 
decorator like Socket.io for Tornadio2. I am looking the documentation 
describing what an event looks like at the HTTP level.

Cheers,
Andrew



On Saturday, January 25, 2014 1:52 PM, Laurens Van Houtven <_...@lvh.io> wrote:
 
Hi Andrew,


No idea about socket.io, but if you're free to pick whatever you want, and you 
just want "websockets, damnit!" then sockjs is actually better, and has 
excellent twisted support.

hth
lvh___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-27 Thread Flavio Grossi
Laurens Van Houtven <_  lvh.io> writes:

> 
> 
> Hi Andrew,
> No idea about socket.io, but if you're free to pick whatever you want, and 
you just want "websockets, damnit!" then sockjs is actually better, and has 
excellent twisted support.hthlvh



Agreed on using sockjs.

There are at least two sockjs server implementation using twisted that i know 
of: sockjs-twisted [1] and (shameless plug) sockjs-cyclone [2]

As per rpc and pubsub support i have personally used wamp [3] and websocket-
multiplex [4] with great success.

Hope this helps,

Flavio


[1] https://github.com/DesertBus/sockjs-twisted
[2] https://github.com/flaviogrossi/sockjs-cyclone
[3] http://wamp.ws/
[4] https://github.com/sockjs/websocket-multiplex



___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Tobias Oberstein
Hi Laurens,

>Hm. I can't find it in the current version. Either I am misremembering, or 
>they expect you to use the pubsub thing as an RPC mechanism somehow (i.e. the 
>room name is the procedure name).

I see. Using PubSub to implement RPC seems hackish at best, if it works at all. 
E.g. how to make sure only 1 implementing endpoint subscribes to the Room (to 
receive procedure calls), how to direct call results to calling clients (since 
only the caller should receive his result), etc etc

Unsurprisingly (probably), I'd like to point to WAMP: http://wamp.ws/

Which was designed from the ground up for exactly this: 1 protocol that covers 
_both_ RPC and PubSub, and runs over WebSocket.

Autobahn|Python implements both WebSocket and WAMP 
(https://github.com/tavendo/AutobahnPython)

End of marketing message;)

/Tobias

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
Hi Tobias,


Hm. I can't find it in the current version. Either I am misremembering, or
they expect you to use the pubsub thing as an RPC mechanism somehow (i.e.
the room name is the procedure name).

hth
lvh
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Tobias Oberstein
>socket.io adds a few things like "RPC support" and "pubsub", ...

Do you have pointers for that?

I can see socket.io supports "topic based pubsub" like functionality via 
"rooms" : https://github.com/LearnBoost/socket.io/wiki/Rooms

What about RPC?

/Tobias


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
On Sun, Jan 26, 2014 at 10:57 AM, Glyph  wrote:

>
> Having had the life-transforming experience of supporting customers using
> *Government-*Quality Web Middleware Server Hardware Firewallâ„¢, in a
> pre-websockets world, with a two-way web application...
>
> No, no I probably wouldn't.
>

Hah; okay, fair enough: that was just a generic warning to those of us who
have not had to stare into the Black Goat of the Rack with a Thousand
Permanently Quiet Sockets...

cheers
lvh
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Glyph

On Jan 26, 2014, at 1:53 AM, Laurens Van Houtven <_...@lvh.io> wrote:

> you'd be amazed how much Enterprise Quality Web Middleware Server Hardware 
> Firewall(TM) screws up websocket connections

Having had the life-transforming experience of supporting customers using 
Government-Quality Web Middleware Server Hardware Firewallâ„¢, in a 
pre-websockets world, with a two-way web application...

No, no I probably wouldn't.

-glyph___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
On Sun, Jan 26, 2014 at 10:46 AM, Glyph  wrote:

> It would be great if someone built a package to do this (more interop is
> always better), but I think interest has generally fizzled on Socket.IO
> implementations in the past because SockJS does pretty much exactly the
> same thing, and as Laurens said, our friends over at Desert Bus for Hope
> maintain great Twisted support for it <
> https://github.com/DesertBus/sockjs-twisted> <
> https://pypi.python.org/pypi/txsockjs>.
>

socket.io adds a few things like "RPC support" and "pubsub", both those are
things that should be spoken over some transport, not part of some
transport, and are trivial to layer over an existing browser transport.

I like SockJS because it's literally just "websockets damnit!". Also, it
doesn't use Flash, which has excellent benefits including no gnarly XML
files to server and not having to wait three seconds to figure out if a
connection works or not (yes, really).

Also: protip, speak SockJS over TLS exclusively. It's not even a security
thing (except yes, that too), but if you do end up speaking websockets
you'd be amazed how much Enterprise Quality Web Middleware Server Hardware
Firewall(TM) screws up websocket connections. TLS, OTOH, they just leave be.

hth
lvh
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Glyph

On Jan 25, 2014, at 12:21 PM, Dustin J. Mitchell  wrote:

> As I understand it, socket.io is a browser-side library that uses any
> of a number of technologies, depending on its environment, to
> communicate with the server.  SSE, Websockets, and long polling are
> all on the list.  Last I looked, though, I didn't see any support for
> the negotiation of which of these protocols to use with a Twisted
> server.
> 
> If that's changed, I'd certainly be interested!

It would be great if someone built a package to do this (more interop is always 
better), but I think interest has generally fizzled on Socket.IO 
implementations in the past because SockJS does pretty much exactly the same 
thing, and as Laurens said, our friends over at Desert Bus for Hope maintain 
great Twisted support for it  
.

It even has endpoints support, including a string parser!  
.

Socket.IO is just a negotiation protocol for deciding whether to use websockets 
though.  If you started with Autobahn I can't imagine it would be more than a 
day or two of work to implement.

-glyph___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-25 Thread Sofiane Akermoun
Hello,
I looked for something that fit your needs few days ago and i came
across txsockjs and i create a server based on twisted and the
https://pypi.python.org/pypi/txsockjs module and i made it in few
minutes. really good stuff.
Of course the client part have to be written in javascript with sockjs
object/api.
If you are sure that you just need websocket and websocket only, there
are also some pure "websocket" implementation in twisted, or you can
probably write your own following the RFC.

For you information there is a kind of flame war on socket.io vs
sockjs, i am not sure which one won the fight, but from my read, and
only from what i have read, sockjs is more promissing and more
supported and more actively maintained.

But as i said and based on my experience and preference only, i did a
lot of research about what i could use to write web app with websocket
support + ajax/comet/long polling technologies and i choose txsockjs.

regards.

Sofiane Akermoun

2014-01-25 Dustin J. Mitchell :
> As I understand it, socket.io is a browser-side library that uses any
> of a number of technologies, depending on its environment, to
> communicate with the server.  SSE, Websockets, and long polling are
> all on the list.  Last I looked, though, I didn't see any support for
> the negotiation of which of these protocols to use with a Twisted
> server.
>
> If that's changed, I'd certainly be interested!
>
> Dustin
>
> On Sat, Jan 25, 2014 at 1:42 PM, Andrew Francis  
> wrote:
>> Hi:
>>
>> I searched the archive but couldn't find an answer so here goes:
>> I am also new to all this
>>
>> I need to write a server that receives socket.io requests. I see Twisted has
>> support for WebSocket. I also see that the Tornado2 socket.io is used
>> alongside Twisted (I didn't know that this was possible). I read that
>> socket.io uses WebSocket whenever possible. I have just started to look at
>> the js implementation of socket.io and the specification. I am trying to
>> gauge how hard is it to write a socket.io protocol/handler. Am I barking up
>> the wrong tree? Or do I really need to learn Tornado?
>>
>> Cheers,
>> Andrew
>>
>> ___
>> Twisted-Python mailing list
>> Twisted-Python@twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python



-- 
Sofiane AKERMOUN
aker...@gmail.com

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-25 Thread Dustin J. Mitchell
As I understand it, socket.io is a browser-side library that uses any
of a number of technologies, depending on its environment, to
communicate with the server.  SSE, Websockets, and long polling are
all on the list.  Last I looked, though, I didn't see any support for
the negotiation of which of these protocols to use with a Twisted
server.

If that's changed, I'd certainly be interested!

Dustin

On Sat, Jan 25, 2014 at 1:42 PM, Andrew Francis  wrote:
> Hi:
>
> I searched the archive but couldn't find an answer so here goes:
> I am also new to all this
>
> I need to write a server that receives socket.io requests. I see Twisted has
> support for WebSocket. I also see that the Tornado2 socket.io is used
> alongside Twisted (I didn't know that this was possible). I read that
> socket.io uses WebSocket whenever possible. I have just started to look at
> the js implementation of socket.io and the specification. I am trying to
> gauge how hard is it to write a socket.io protocol/handler. Am I barking up
> the wrong tree? Or do I really need to learn Tornado?
>
> Cheers,
> Andrew
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Protocol for socket.io

2014-01-25 Thread Laurens Van Houtven
Hi Andrew,


No idea about socket.io, but if you're free to pick whatever you want, and
you just want "websockets, damnit!" then sockjs is actually better, and has
excellent twisted support.

hth
lvh
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Protocol for socket.io

2014-01-25 Thread Andrew Francis
Hi:

I searched the archive but couldn't find an answer so here goes:
I am also new to all this

I need to write a server that receives socket.io requests. I see Twisted has 
support for WebSocket. I also see that the Tornado2 socket.io is used alongside 
Twisted (I didn't know that this was possible). I read that socket.io uses 
WebSocket whenever possible. I have just started to look at the js 
implementation of socket.io and the specification. I am trying to gauge how 
hard is it to write a socket.io protocol/handler. Am I barking up the wrong 
tree? Or do I really need to learn Tornado?

Cheers,
Andrew___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python