Define port range for service?

Attempting to deploy this WebRTC project:

By default, the project wants UDP ports 50000-60000 open.

Is it possible to define a port range for an application, instead of a single port per service handler?

Is this only for UDP? The way our UDP handling works, the port actually has no effect. You can listen on any UDP range from your app and you’ll receive the traffic. If you’re not listening, it gets dropped.

TCP doesn’t currently have a way to do ranges.


@matt4 Were you able to get livekit running on fly? I was just attempting that myself and haven’t found a configuration that works properly for it. I have a suspicion that they way it’s trying to handle ports may not be compatible with fly’s methodology.

@bekit yes, it took some fiddling in fly.toml and the livekit config to get everything aligned. Works fantastic, even on the smallest instance now.

1 Like

Can you post an config for Fly and Livekit? From the docs, livekit seems to suggest that the individual nodes must be directly addressable from the internet for ICE traffic.

Yeah, I’ll actually post a full quickstart guide soon. Just need to finish cleaning a couple of things up :slight_smile:

The short answer is that LiveKit will work as long as it’s a 1:1 route. So if you have one node per ipv4 address, it’s fine to send it through the Anycast address, though you lose the load balancing aspect and have to do some other tricks if you want to run multiple nodes at once.

1 Like

Would you be able to share your config?

Hey! you ever get the livekit instance to work?

I was! I actually wrote up a quick start guide for it: GitHub - bekriebel/livekit-flydotio: An example on how to deploy LiveKit on

This only handles a single instance. It’s possible to run a cluster, but it takes a few more steps and isn’t as well suited to Fly due to the need to have an adressible IP per node.

1 Like