flutter-webrtc / flutter-webrtc-server

A simple WebRTC signaling server for flutter-webrtc.
MIT License
756 stars 304 forks source link

请教下,服务器启动了,没达到预期效果 #8

Closed Leadrive closed 5 years ago

Leadrive commented 5 years ago

用了二级域名指向,服务器启动后,在浏览器中访问,列表内容为空

用flutter-webrtc-demo app,输入我的服务器域名,列表中的内容为空。 在APP中,输入 demo.cloudwebrtc.com,列表中是有内容。

请问,哪里没弄对?

我是按照说明来的。 Clone the repository, run npm install. Run npm start and open https://your_sever_ip_or_domain:8086 to use html5 demo.

cloudwebrtc commented 5 years ago

请先检查 4442 服务器端口能否通过域名访问。

Leadrive commented 5 years ago

请问,我现在是把8086端口,反向代理到二级域名了, 4442端口,我在阿里云安全组中,已允许该端口,还需要怎么特殊处理吗?

cloudwebrtc commented 5 years ago

4442,4443,8086 三个端口都需要允许。

Leadrive commented 5 years ago

三个都开了,还是不行。 这是我的demo,麻烦看看 https://webrtc.touroad.cn

Leadrive commented 5 years ago

这是我的nginx.conf的配置,感觉这里,如何把4442/4443,通过域名访问?

upstream webrtcServer { server 0.0.0.0:8086; } server { listen 80; server_name webrtc.touroad.cn; return 301 https://webrtc.touroad.cn$request_uri; } server { listen 443 ssl; server_name webrtc.touroad.cn; index index.html index.htm index.php; ssl on; ssl_certificate /home/ssl/webrtc.touroad.cn.pem; ssl_certificate_key /home/ssl/webrtc.touroad.cn.key; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; gzip_min_length 1k; gzip_comp_level 2; gzip_types text/plain text/css application/xml image/jpeg image/gif image/png image/jpg text/javascript application/javascript; location / { proxy_pass https://webrtcServer; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
cloudwebrtc commented 5 years ago

wss://webrtc.touroad.cn:4443 , ws://webrtc.touroad.cn:4442端口无法打开,请检查一下防火墙规则。 另外 请将nginx 所用的证书,也替换到flutter-webrtc-server/certs 目录下

Leadrive commented 5 years ago

我的防火墙,都设为-1/-1了,还是不行。 感觉是我的nginx.conf没配对,listen 80, 请问4442,4443,如何配到nginx上?

另外,用ws://120.79.137.82:4442,wss://120.79.137.82:4443,也不通。

Leadrive commented 5 years ago

请问,能贴下 demo.cloudwebrtc.com的nginx.conf吗?

Leadrive commented 5 years ago

有个疑问,nginx中,如何配置才能把ws反向代理到4442,把wss反向代理到4443呢? 又不与之前的http, https相冲突。

即是通过 demo.cloudwebrtc.com,同时支持http, https, ws, wss,请问如何做到的? 谢谢。

Leadrive commented 5 years ago

可以了,还是防火墙的问题。谢谢。