Websocket and regular http requests on the same port?

635 views
Skip to first unread message

Ryan Chazen

unread,
Nov 8, 2013, 1:05:51 PM11/8/13
to ve...@googlegroups.com
I can't work out how to run both websocket and normal http requests off the same server.

eg.

http://example.com/cat/5 would return a rest json response
http://example.com/images/cat.jpg would return an image out of the module
http://example.com/chat would be a sockjs or websocket connection

The first two are simple enough with a router, but I have no idea how to integrate the 3rd.
What's the best way to do this..? Seems pretty standard, I think most new services would need urls like this.

Tim Fox

unread,
Nov 8, 2013, 1:07:38 PM11/8/13
to ve...@googlegroups.com
On 08/11/13 18:05, Ryan Chazen wrote:
I can't work out how to run both websocket and normal http requests off the same server.


eg.

http://example.com/cat/5 would return a rest json response
http://example.com/images/cat.jpg would return an image out of the module
http://example.com/chat would be a sockjs or websocket connection

The first two are simple enough with a router, but I have no idea how to integrate the 3rd.
What's the best way to do this..? Seems pretty standard, I think most new services would need urls like this.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ryan Chazen

unread,
Nov 8, 2013, 1:13:11 PM11/8/13
to ve...@googlegroups.com
Ah, thanks, very nice - didn't realise you could chain the two different types of handlers like that.



--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/ooQ17NHaTR0/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to vertx+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages