Danish Shrestha
Danish Shrestha

Reputation: 487

integrating websockets using Netty with Spring web app running in tomcat

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

Answers (4)

Pidster
Pidster

Reputation: 618

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

Upvotes: 0

Abe
Abe

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)

link1 link2

Upvotes: 1

Niklas Schnelle
Niklas Schnelle

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

Related Questions