Hi > Hi, > > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket > example and when I'm trying to run it in my server for all 4 examples > (Echo, chat, etc..) > I'm getting > >> Info: WebSocket connection closed, Code: 1006 > > > In the console it prints > > WebSocket connection to 'ws:// >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error >> during WebSocket handshake: Unexpected response code: 302 > > > This same war file is running perfectly on Tomcat distribution. > > Can someone tell me what could be the reason for this?
It looks like you haven't deployed the WebSocket examples correctly. My guess is you are seeing the 302 redirect to /examples/websocket/echoProgrammatic/ you'd get if this was being handled as a static resource. Thanks for quick response. But I think you misunderstood what I mean. I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error during WebSocket handshake: Unexpected response code: 302 I'm getting that for the echo sample programmatic API option. For each and every websocket sample I'm getting Info: WebSocket connection closed, Code: 1006 And in the console it says something like WebSocket connection to ws://10.100.7.26:9763/examples/websocket/ <http://10.100.7.26:9763/examples/websocket/echoProgrammatic>... failed: Error during WebSocket handshake: Unexpected response code: 302 2015-04-23 12:58 GMT+05:30 Mark Thomas <ma...@apache.org>: > On 23/04/2015 05:51, Thusitha Thilina Dayaratne wrote: > > Hi, > > > > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket > > example and when I'm trying to run it in my server for all 4 examples > > (Echo, chat, etc..) > > I'm getting > > > >> Info: WebSocket connection closed, Code: 1006 > > > > > > In the console it prints > > > > WebSocket connection to 'ws:// > >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error > >> during WebSocket handshake: Unexpected response code: 302 > > > > > > This same war file is running perfectly on Tomcat distribution. > > > > Can someone tell me what could be the reason for this? > > It looks like you haven't deployed the WebSocket examples correctly. My > guess is you are seeing the 302 redirect to > /examples/websocket/echoProgrammatic/ you'd get if this was being > handled as a static resource. > > Mark > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > --