aiortc / aioice

asyncio-based Interactive Connectivity Establishment (RFC 5245)
BSD 3-Clause "New" or "Revised" License
104 stars 49 forks source link

block/allow interfaces #57

Open zhuker opened 2 years ago

zhuker commented 2 years ago

The following will ignore all docker interfaces when gathering candidates

ice.get_host_addresses(block_list=["docker*"])

The following will only allow ethernet interfaces when gathering candidates

ice.get_host_addresses(block_list=["eth*"])
sirf commented 1 year ago

The following will only allow ethernet interfaces when gathering candidates

ice.get_host_addresses(block_list=["eth*"])

It should it be allow_list=["eth*"]) right?

jlaine commented 1 year ago

I don't plan on merging this as-is as I can see this leading to a proliferation of options for allowing / blocking not only interfaces but specific addresses. Another option would be to introduce a filter_host_addresses callable which you can use to do whatever you want. This could in fact superseed the use_ipv4 and use_ipv6 parameters.