kyriesent / node-rtsp-stream

Stream any RTSP stream and output to websocket for consumption by jsmpeg (https://github.com/phoboslab/jsmpeg). HTML5 streaming video! Requires ffmpeg.
MIT License
451 stars 166 forks source link

wss not working #48

Open NatanGuardicore opened 4 years ago

NatanGuardicore commented 4 years ago

Hi, after deploying it to my server (heroku) , it doesn't work because it requires a secure connection wss. someone managed to solved it?

kyriesent commented 4 years ago

I haven't looked much into using wss with this. If you find a solution please feel free to add a PR. Thanks!

kyriesent commented 4 years ago

@NatanGuardicore if you haven't already, take a look at #37 that will probably get you going in the right direction.

mmeyers-solartech commented 4 years ago

I'm definitely still hung up on this, I can't seem to get the advice in #37 to work. The advice is good and best practice (passing https server as constructor to ws server) but it's missing a few pieces and logistics that I can't quite seem to glue together. Any help is appreciated. The first reply on #37 is the approach I took but it's missing pieces like where to "listen" because as it is, that server closes immediately.

Kavyeshs41 commented 4 years ago

Can we use webservers to offload SSL/TLS termination? NGINX or Apache can easily handle SSL/TLS terminations for wss. Isn't that a good idea?

jzzxh commented 1 year ago

I found the solution that using nginx proxy transport ws to wss, the url would be like ws://localhost/websocket

Config of Nginx /// location /websocket {
proxy_pass http://localhost:9999; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
}

///

hope it helps.