philippe44 / LMS-ShairTunes2W

Airtunes with LMS (fork of https://github.com/disaster123/shairport2_plugin)
65 stars 3 forks source link

Is it possible to limit the port range being used by the helper program? #35

Closed hansherlighed closed 3 years ago

hansherlighed commented 3 years ago

Hi,

I'm trying to run your plugin in the "official/community" docker LMS image, and I'm not able to get it working without sing the HOST network option for the container. I'd rather not use the HOST network in my container. From what i can gather, the issue with running your plugin in docker is that the helper program assigns dynamic port numbers for each of the squeezebox devices, and therefore it is not possible to setup the correct port forwarding/publishing in docker. Is it possible to: 1: know what the range of port numbers re being used by the plugin 2: somehow limit the port range? I only have 4 devices, so a port range of 10-20 ports should be enough.

Thanks.

philippe44 commented 3 years ago

No, ports are fully dynamic

cbueche commented 3 years ago

Hi, same issue for me, see my forum post.

philippe44 commented 3 years ago

Ports can now be set

lorenzoferrarajr commented 3 years ago

Thank you @philippe44, can you describe how to use the Inbound ports option? The description states:

AirPlay protocol requires three incoming ports and the built-in webserver needs another one. Set the base value and count (don't forget to open these in your firewall). Leave empty for automatic selection

Questions:

Thank you!

philippe44 commented 3 years ago

Each player requires one port when it is just listening for possible incoming connection and when it is playing it requires 3 extra ports. So you chose one "base" port that is available in your system (really, your choice, use netstat maybe to get some help) and then you tell the helper that it can use up to "count" ports from that base. Every helper for every player will decide automatically select 4 available ports in that range: "base ... base+count".

The base and count parameter are shared accross all players, so if you have 4 SB devices that you want to be used at the same time by AirPaly, then you need at least 4*4=16 ports. Don't be cheap then, allow 32 :-)

lorenzoferrarajr commented 3 years ago

Great explanation, thank you!