2
votes

I'm learning about webrtc and followed the instructions here: https://www.tutorialspoint.com/webrtc/webrtc_rtcpeerconnection_apis.htm

I'm using tomcat v8.0 for deploying my web application, I got following error in Console Window :

WebSocket connection to 'ws://localhost:8080/Connection' failed: Error during WebSocket handshake: Unexpected response code: 302

My webapplication works fine, if I use http://localhost:8080/Connection/ link in url locator. If I use ws://localhost:8080/Connection in url locator, Im getting:

This site can’t be reached

I cannot figure out why I am getting 302. Can anyone help me to resolve this?

1
is your application fronted by an Apache ? - niilzon
Yep,Apache Tomcat8 - kavie
I mean do you use an Apache httpd (web server) to front your Tomcat ? In which case you probably have to inform the web server (httpd) that the Websocket protocol comes into play - niilzon
Or, are your requests directly hitting the Tomcat - niilzon
Is this path is secured by spring security or something else. Once logout your session and try to open localhost:8080/Connection status code 302 means your request is being redirected, so you should check security settings and filters - Anil Agrawal

1 Answers

1
votes

You try this input The browser:http://localhost:8080 The WebSocket:ws://localhost:8080/Connection The browser can not be http://127.0.0.1