giongto35 / cloud-game

Web-based Cloud Gaming service for Retro Game
https://www.youtube.com/watch?v=GUBrJGAxZZg
Apache License 2.0
2.32k stars 348 forks source link

Change range UDP ports #329

Closed silviacesari95 closed 3 years ago

silviacesari95 commented 3 years ago

Hi, is there a way to restrict the range of udp ports used by the streaming?

sergystepanov commented 3 years ago

Hey! Yes, I implemented that as an experement quite some time ago in order to use Docker's default portmapper. Check this issue #257 for an example. Keep in mind, when you set this port-range limiter (for WebRTC UDP) you will limit the total number of concurrent players to the number of allowed ports. (also I'm not sure [remember] how it behaves when the limit is reached) Recently, Pion (WebRTC lib that we use) has implemented port multiplexing which allows defining just one open port for multiple connections (users). That would be a go-to method to deal with Docker/k8s setups but haven't had much time for it.

giongto35 commented 3 years ago

Yeah, as Sergy said, it is possible now with the library and is a great thing to prioritize. I can try setting port range together with Kubernetes as well.