flutter-webrtc / flutter-webrtc-server

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

How to deploy on production #30

Closed Sourabhgoyal closed 3 years ago

Sourabhgoyal commented 4 years ago

Hi, how can we deploy the server on production, I see that the turn server is already included in this. Is there a separate Turn server required to deploy. If yes, where should the configuration of the same be updated. If no, where should the ip of live server be updated. Thanks in advance.

kjpopov commented 4 years ago

I am also considering using this example for a project in production, please contribute a production setup or at least some info/guidelines where to go from here in this issue will be highly appreciated.

ZeroCoolCWN commented 4 years ago

Atleast some guidance on the turn server configuration would be great!

kjpopov commented 4 years ago

Hello ZeroCoolCWN!

There is a file inside config folder called config.ini https://github.com/cloudwebrtc/flutter-webrtc-server/blob/3a7ad02a3eca51218839d26a08267fe1318defef/configs/config.ini There is a section [turn] public_ip=127.0.0.1 / Change This to The real public IP of your server / Make sure both ports (8086 and 19302) are open in the firewall (security group) of your server. Compile the server from latest master.

On the client side you need to go to: https://github.com/cloudwebrtc/flutter-webrtc-demo/blob/ff4a8118d46c831eb5ee972900f652b337b9a014/lib/src/call_sample/signaling.dart On line 59 to 68 there is some commented code that you should play with. I am not sure if you need stun and turn maybe just turn is enough.

If this does not work you can try to setup your own turn server as per the example of the PION guys. https://github.com/pion/turn/blob/master/examples/turn-server/simple/main.go

Please post back if you manage to make it work behind nat routers. I will be happy to call you via my app installed on my testing phone.

Note: I just did the research part It is still in the bottom of my todo list to give it try.

larrylisky commented 4 years ago

I was able to install coturn on an AWS/EC2 by following this post. Then create another EC2 instance to run flutter-webrtc-server following the 'make' instruction. Hook them up based on @kjpopov recommendation. Tested with two iphone devices on separate LAN. flutter-webrtc-server did crash once which I need to investigate why. But this setup works.

subhendukundu commented 4 years ago

@kjpopov, @larrylisky Seems like a good plan. Can you add some details on the performance? I mean how many people connect at the same time? Also, what will be data consumption? What's CPU size needs to create multiple rooms? As I see its just using turn, not SFU etc it should able to support any number of rooms? A benchmark would totally help.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Ameenhamed commented 7 months ago

Has anyone found a solution!!