Skip to content

Add a way of limiting the range of the ephemeral ports that are bound to by gather_candidates #47

@gregvish

Description

@gregvish

Hi!

Inside get_component_candidates under the Connection class, the local UDP ports are randomly selected by the kernel, since 0 is provided as the port to create_datagram_endpoint. I have a use-case where I need this port range to be limited. Indeed, it's possible to limit it on the whole machine, by setting the /proc/sys/net/ipv4/ip_local_port_range under Linux. However, I need this to be controllable at a more fine grained level.

Could an addition of some kind of allowed_port_range flag be considered? In the implementation, this would require manually trying to bind to ports in the range until success.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions