Vert.x 3 socket.io module?

547 views
Skip to first unread message

Frank Grimes

unread,
Feb 24, 2016, 2:12:51 PM2/24/16
to vert.x
Hi All,

I'm looking at rewriting an old node-js server application which relies on socket.io.

However, it seems to only be for Vert.x 1.x.

I also found the following which seems to be for Vert.x 2.x: https://github.com/hubrick/mod-socket-io

However, I haven't been able to find one which is available for Vert.x 3.x.
Also, so far my attempts to bring the 2.x one in line with 3.x APIs has been unsuccessful. (note that I am new to Vert.x so neither the old nor new APIs are yet familiar to me)

Does a 3.x module/verticle exist for this?
Any suggestions?

Thanks,

Frank

Paulo Lopes

unread,
Feb 25, 2016, 5:12:20 AM2/25/16
to vert.x
There is no support for socket.io at the moment however we do have support for sockjs. I think that sockjs will offer you pretty much everything socket.io does so it should be a good replacement (of course i've no idea of your use case so this is a gut feeling).


Cheers,
Paulo

Frank Grimes

unread,
Feb 25, 2016, 9:19:50 AM2/25/16
to vert.x
Hi Paolo,

It does look like sockjs offers all the support we need. (It doesn't seem to support Flash sockets but at this point I think we can live without it given the state of current browsers in the wild)

Thanks!

Frank

Paulo Lopes

unread,
Feb 26, 2016, 2:48:43 AM2/26/16
to vert.x
Hi Frank,

I'm not sure why you need flash but if it is because you need to support older browsers you'll see that sockjs can even support old IE6 or even Opera with Iframes and pooling...

sameer uddin

unread,
Apr 29, 2018, 10:34:39 PM4/29/18
to vert.x
Hi , I am having lots of problems with sockjs using vertx event bus bridge with web socket. I got stateless services on the event bus (these need user Context). I needed to pass JWT token to the server when creating socket connection. This gets the user details and keeps them with the socket. Now for every event send by the client i can stamp the user details in the socketJs handler on the server which i can receive from jwt . But the problem is passing JWT token as socketjs does not allow to add custom headers. Any ideas or approaches that could help me with this. On the server side i can get the headers easily. Also if the token is invalid i can disallow the connection.  

Paulo Lopes

unread,
May 7, 2018, 3:29:00 AM5/7/18
to vert.x
The SockJS bridge allows you to send headers with your messages.

You could pass the JWT token there and use on the server side as it should be present on the headers of the message.
Reply all
Reply to author
Forward
0 new messages