StevenLooman / async_upnp_client

Async UPnP Client for Python
Other
46 stars 37 forks source link

Multiple interface support #229

Closed lucasangarola closed 5 months ago

lucasangarola commented 6 months ago

First of all thank you for this fantastic library!

I have multiple network interfaces in my machine and when requesting a search or listening for advertisements seems to be binding to one specific interface (most times WiFi).

What would be the approach to bind to a specific interface? Since I have a distributed system along different networks (separated interfaces), Would be possible to interact with multiple interfaces?

Using: Python 3.11 Tested the lib using upnp-client --pprint --debug-traffic search upnp-client advertisements

Thank you in advance!

StevenLooman commented 5 months ago

Thank you for your kind words @lucasangarola!

When using the CLI, you can use the --bind option to bind to a specific interface. This option is available for the search, advertisements and subscribe sub commands.

When using the library itself, you can set the source to use a specific IP/IPv6 address to bind to. The CLI itself shows how to do this.

StevenLooman commented 5 months ago

Although I do see that the bind option is never used for the subscribe command. It should not have to be used, as the OS should pick the right interface when subscribing to a specific device.

I think I'll remove the bind option for the subscribe command in the near future.

StevenLooman commented 5 months ago

Does this fix your problem @lucasangarola?

lucasangarola commented 5 months ago

@StevenLooman Thank you very much, this answers and solves my problem.

StevenLooman commented 5 months ago

Thank you. Closing this issue.