Error during WebSocket handshake: Unexpected response code: 400

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error during WebSocket handshake: Unexpected response code: 400

brandon
HI all, I've been trying to get Websockets support going in the latest version of Red5 Pro, but the built-in broadcast tests are consistently failing.  I've tried this on an AWS server and an localhost -- same result:

red5pro-sdk.min.js:13 WebSocket connection to 'ws://192.168.1.104:8081/live?id=test' failed: Error during WebSocket handshake: Unexpected response code: 400

This is local, having just installed red5 pro, run red5.sh, and opened the browser to the main Broadcast page.  I made sure to set the "IP" to "localhost."  No additional setup -- all unsecured protocols.

However, on my AWS host, I went through the entire HTTPS setup with Let's Encrypt.  I'm getting valid https on the browser. It's attempting wss:// on a 8083 (which I can telnet to).  All required ports are open to the world.  I just keep getting that response code 400.


Since 400 indicates a malformed request, I'll paste the localhost GET below.  Please, does anyone know anything that may help?

    1. Request URL:
      ws://localhost:8081/live?id=test
    2. Request Method:
      GET
    3. Status Code:
      400 Bad Request
  1. Response Headersview source
    1. Sec-WebSocket-Version-Server:
      13
  2. Request Headersview source
    1. Accept-Encoding:
      gzip, deflate, sdch, br
    2. Accept-Language:
      en-US,en;q=0.8
    3. Cache-Control:
      no-cache
    4. Connection:
      Upgrade
    5. Cookie:
      [redacted, but can paste if relevant]
    6. Host:
      localhost:8081
    7. Origin:
      http://localhost:5080
    8. Pragma:
      no-cache
    9. Sec-WebSocket-Extensions:
      permessage-deflate; client_max_window_bits
    10. Sec-WebSocket-Key:
      9PLIgfT7annkoDHNYlmCCw==
    11. Sec-WebSocket-Version:
      13
    12. Upgrade:
      websocket
    13. User-Agent:
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
  3. Query String Parametersview sourceview URL encoded
    1. id:
      test

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error during WebSocket handshake: Unexpected response code: 400

brandon
 


Finally got it to work.  I poured through the docs and discovered a few additional things.  I'm not 100% sure what fixed it, but going to Ubuntu and making sure packages were all installed was a huge part.

First,  I reviewed the WebRTC setup doc on Red5.  There is one configuration item related to "Cloud Hosted Servers" and another to AWS specifically.

Then I read the Ubuntu setup page.  I noticed several package dependencies listed for webRTC:  libva1, etc.

I had installed on Amazon Linux (centOS), and yum did not find these packages. So I resolved to reinstall on Ubuntu.

I re-did everything. Red5 install, DNS setup, SSL configuration. I made sure to install those packages and make those config changes I mentioned.

Now, finally, the demo stream page works. Now on to actually update my app... :-/

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.