FD- / RPiPlay

An open-source AirPlay mirroring server for the Raspberry Pi. Supports iOS 9 and up.
GNU General Public License v3.0
4.93k stars 353 forks source link

Use static ports #196

Closed Waester closed 3 years ago

Waester commented 3 years ago

Set network ports to static ones, easier to manage when RPiPlay is behind a firewall. Port selection is based on reversed engineered AirPlay protocol documentation.

https://github.com/FD-/RPiPlay/blob/e485668f752cedf9d1304ca08d5b2f2d03b67063/rpiplay.cpp#L384 port = 7000 (source)

https://github.com/FD-/RPiPlay/blob/e485668f752cedf9d1304ca08d5b2f2d03b67063/lib/raop_ntp.c#L192 tport = 7011 (source)

https://github.com/FD-/RPiPlay/blob/e485668f752cedf9d1304ca08d5b2f2d03b67063/lib/raop_rtp.c#L231 cport = 6001 (source & source) dport = 6000 (source)

https://github.com/FD-/RPiPlay/blob/e485668f752cedf9d1304ca08d5b2f2d03b67063/lib/raop_rtp_mirror.c#L506 dport = 7100, (source)

pallas commented 3 years ago

As a future enhancement, I wonder if adding a command-line flag to say "use random ports" would be useful in cases where someone is running multiple rpiplays at the same time. But this commit looks great to me, thanks for doing all the research. @FD- what do you think?

FD- commented 3 years ago

Yup, a command-line flag is the sensible thing to do here IMO.

pallas commented 3 years ago

Can you please put the static ports behind a command-line option that enables/disables these defaults?

fduncanh commented 3 years ago

I modified my copy of source to use ports 6000/udp, 6001/udp, 7011/udp, 7000/tcp, 7100/tcp and opened these ports (on openSUSE15.2, with Nvidia graphics on a PC not raspberry pi).

I can confirm RPiPlay now works with the firewall on . (I originally posted to say it didnt, but I missed opening port 7000) Thanks Waester! (and the RPiPlay authors/maintainers)! It would be good to get this merged....

feijoas commented 3 years ago

This PR also works on NixOS.

ned-kelly commented 3 years ago

Any chance e can have this merge approved? @FD-

fduncanh commented 3 years ago

This is an excellent enhancement. It is still waiting to a command line option to enable or disable static ports which FD- and pallas asked for before committing it. can you sort this out?

(A second very useful enhancement for zoom users is one I backported from a pull request to the (unmaintained) UxPlay fork of this project, allowing zoom to recognize the gstreamer window. I left a patch for this in "issue" #224.)

fduncanh commented 3 years ago

command line option implemented. see pull request #249