fbsamples / Canvas-Streaming-Example

This project contains example code showing how to go live on Facebook using a <canvas> element as a source.
Other
340 stars 73 forks source link

WSS Proxy #9

Closed mark-mdgam closed 4 years ago

mark-mdgam commented 4 years ago

Hello, I'm having a lot of fun with this sample

I have setup my own RTMP server for streaming to and broadcasting works fine.

However, I need this functionality on a secure https page. Of course, ws:// wont work. I have setup Apache mod_proxy and mod_proxy_wstunnel before for a webrtc project, and that works fine. For this node project, in Apache sites-enabled I set ProxyPass and ProxyPassReverse to: "/node http://127.0.0.1:3000" and "/node-ws ws://127.0.0.1:3000" respectively. The canvas loads over https but when I hit the Go Live button, I get the error:

WebSocket connection to 'wss://hostname.com/rtmp/rtmp%3A%2F......' failed: Error during WebSocket handshake: Unexpected response code: 404

Anybody have suggestions how I can resolve this?

mark-mdgam commented 4 years ago

To anybody who might encounter same issue, just get a cert for nodejs websocket.. still can't get the proxy working

randallb commented 4 years ago

You might want to try using something like puma-dev which can proxy connections securely.

https://github.com/puma/puma-dev

It explicitly supports websockets.