(Massive) port ranges for internal ports?

I’m PoCing a naive custom UDP proxy to provide auto-start capabilities for services that normally receive only UDP traffic. Each machine in the target app is essentially a pet right now, and new ones can be spun up and down constantly. Each runs its service on a port number unique to machines within the app. My proxy exposes that machine externally at the same port the machine itself uses. I’m no networking expert, but I don’t think I can distinguish UDP connections bound for this particular machine any other way.

There can potentially be hundreds or thousands of such externally exposed ports on my proxy service. I know I can define port ranges for the external ports, which map to a single internal port. If I want to map many external ports to many internal ports (say, 20000 of them), do I have no other option than to specify 20000 individual services? I haven’t even tried that yet, and don’t know how the API would respond.

It would be awesome to be able to define a port range that’s 1:1 mapped internally and externally. Although I suppose the real wishlist item would be to have autostart via UDP connection working like it does over TCP, and then I don’t have to write this hackery at all :wink:

1 Like