marco.m
unread,Mar 14, 2013, 6:11:02 AM3/14/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Tufão
Hey Vinícius,
since we are talking about the request router :-) consider this
scenario:
I want to build a web server that handles *both* HTTP and WebSockets.
For the HTTP part, I am using the request router. It is an elegant way
and I like it. But, I also need websockets. To my understanding, to
handle websockets, I must create my own server inheriting from
Tufao::HttpServer and then overriding upgrade().
So I have a router and a custom server, and I connect the two via
requestReady/handleRequest. It works fine.
By now, I think you are seing where I am going. If the websocket
server needs to handle multiple URLs, it must do it in upgrade(), by
switching around request->url(). But this is exactly what the router
was meant to solve!
Said in another way, I would like, conceptually, to have the router
handling both http:// and ws:// URL schemes. Either the same router,
or two routers.
Any ideas?
marco.m