Reputation: 487
I have a web socket server implementation using Netty (say listening on port 8081) and a separate Spring web application running in Tomcat (running in port 80).
I would like to somehow forward all request coming to localhost:80/Websocket to my Netty server on port 8081. Is this possible at all. since Tomcat and spring is build on top of http protocol, idk how this would be possible.
All I wanted to do is enable server push using websocket from my existing spring web app. Any suggestions?
Upvotes: 3
Views: 4248
Reputation: 731
Netty can handle HTTP. E.g. http://static.netty.io/3.5/xref/org/jboss/netty/example/http/snoop/package-summary.html
Upvotes: 0
Reputation: 618
Why not just use the WebSocket support in the latest Tomcat (7.0.27)?
Upvotes: 0
Reputation: 9031
Take a look at the following 2 links which show how to have netty configured using spring. I have done it in grails wherin a netty socket server is running within tomcat, listening on a particular port for binary packets(not http)
Upvotes: 1
Reputation: 1249
The easiest way would probably be to put an nginx server up front and have it forward requests to /Websockets, however because Websockets is not Http 1.0 you can't use normal ProxyPass directives but according to http://www.letseehere.com/reverse-proxy-web-sockets it's possible via a special plugin
Upvotes: 2