3

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?

Danish Shrestha
  • 487
  • 5
  • 16

4 Answers4

2

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

Niklas Schnelle
  • 1,139
  • 1
  • 9
  • 11
1

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)

link1 link2

Community
  • 1
  • 1
Abe
  • 8,623
  • 10
  • 50
  • 74
0

Why not just use the WebSocket support in the latest Tomcat (7.0.27)?

Pidster
  • 628
  • 4
  • 9
  • Websocket support in tomcat 7 is not stable according to the documentation on the tomcat 7 website , which in turn is due to the websocket protocol itself not being finalized. Seeing that warning , I tried Netty websocket server configured using spring in tomcat instead and it works fine. – Rndm Jul 13 '12 at 04:26
  • No, the Tomcat feature is not finalized because it is a prototype ahead of the likely implementation required for Servlet 3.1 which will probably support WebSockets; the protocol itself was finalized last year. – Pidster Jul 14 '12 at 20:23
0

Netty can handle HTTP. E.g. http://static.netty.io/3.5/xref/org/jboss/netty/example/http/snoop/package-summary.html

jack
  • 731
  • 7
  • 8