hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger-web: default port 5000 sometimes conflicts on macOS

Open themaxdavitt opened this issue 2 years ago • 3 comments

Hi! I'm using hledger 1.28 mac-aarch64 on macOS Sonoma 14.1.2 (23B92). Sometimes when I try to use hledger-web with its default port of 5000 I have trouble connecting to the web server, and I suspect that this is because as of Monterey port 5000 is being used by AirPlay Receiver. AFAICT you can check if AirPlay Receiver is serving on that port by looking for a header like Server: AirTunes/123.45.6.

I'm not sure how to reliably reproduce this; hopefully I'm not the only one who's encountering it. 😅 I know the version I'm using is outdated but it doesn't look like this has changed in the meantime. Please consider changing the default port for hledger-web on macOS to something else. Thank you!

themaxdavitt avatar Dec 23 '23 21:12 themaxdavitt

Thanks for the report. I have noticed that use of 5000 by Apple, but have not experienced the clash myself. I'm open to a PR changing this, although it may touch a lot of docs and scripts. 3000 is one I have used. But what's a good way to pick a nice mnemonic number with a low chance of having to change it again ?

simonmichael avatar Dec 23 '23 21:12 simonmichael

https://serverfault.com/questions/11806/which-ports-to-use-on-a-self-written-tcp-server suggests using 49153 or greater.

I would like to pick 50000, but various things use that: https://www.speedguide.net/port.php?port=50000

https://www.speedguide.net/port.php?port=49999 is the first one I've found with no known users, but it's ugly.

simonmichael avatar Dec 23 '23 21:12 simonmichael

https://www.speedguide.net/ports.php?filter=55550 is another free one.

simonmichael avatar Dec 23 '23 21:12 simonmichael