sfu-ws Deployment Failure on Web (Successful in Local Environment)
ponyo877 opened this issue · comments
Your environment.
- Version: https://github.com/ponyo877/example-webrtc-applications folk from master(1956024) for web deploy
- Browser: Google Chrome 121.0 & Firefox 122.0
- Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context
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:
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.