pion / example-webrtc-applications

Examples of WebRTC applications that are large, or use 3rd party libraries

Home Page:https://pion.ly/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sfu-ws Deployment Failure on Web (Successful in Local Environment)

ponyo877 opened this issue · comments

Your environment.

What did you do?

I create a video and audio communication service using the WebRTC package, Pion, in Go.
I made some modifications to sfu-ws in pion/example-webrtc-applications and deployed it on the web.
https://sub.folks-chat.com/ (fail)

What did you expect?

Please let me know what can be improved.

What happened?

when I made some modifications to sfu-ws in pion/example-webrtc-applications and deployed it on the web, the ICE connection state always transitions from 'new' to 'checking' and then to 'disconnected', and I am unable to establish a video call.
(In my local environment, I was able to successfully make a video call.)
Please let me know what can be improved.

Here are the modifications I made:

  • Added TURN and STUN servers to the settings when creating PeerConnection
    • TURN server: Used account information issued by expressturn
    • STUN server: stun:stun.l.google.com:19302
    • With the above two settings, the type of Trickle ICE transitions from host->srflx->Done->relay
  • (Embedded index.html to dockerize)
  • Changed the websocket protocol in index.html from ws to wss
  • Placed nginx in front of the sfu-ws application
  • Implemented HTTPS communication by setting a certificate obtained from Lets Encrypt to nginx
  • Deployed by installing docker on a VM instance of Google Cloud

The above configuration is published at https://sub.folks-chat.com/ (as mentioned above, WebRTC is not implemented).

Here are the codes I used:

Everything is made by forking pion/example-webrtc-applications. The changes can be easily understood by looking at the following two commits:

Hey @ponyo877!

Thanks for using Pion. I responded to your question on Stackoverflow here

Happy to help here, stackoverflow or on Slack

Thanks you, Your point was right on the money!

It was due to the fact that I was using a container, which resolved.
I solved it by adding network_mode: host to the container.

commit 36a4708