node-rtsp-stream icon indicating copy to clipboard operation
node-rtsp-stream copied to clipboard

wss not working

Open NatanGuardicore opened this issue 6 years ago • 5 comments

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

NatanGuardicore avatar Feb 04 '20 13:02 NatanGuardicore

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

kyriesent avatar Feb 12 '20 14:02 kyriesent

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

kyriesent avatar Feb 12 '20 14:02 kyriesent

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.

mmeyers-solartech avatar May 06 '20 19:05 mmeyers-solartech

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?

Kavyeshs41 avatar Aug 29 '20 18:08 Kavyeshs41

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.

jzzxh avatar Nov 10 '22 03:11 jzzxh