Closed keilin-anz closed 2 years ago
I was thinking possibly -l
or --listen
which set an address, say 0.0.0.0
or a regular IP.
Default value is still localhost
The code is simple too:
address := flag.String("l", "localhost", "address to listen on")
Addr: fmt.Sprintf("%s:%d", *address, *port),
I was thinking possibly -l or --listen which set an address, say 0.0.0.0 or a regular IP. Default value is still localhost
Looks like @samuong is on board with that, will update
Amusingly, I was intentionally avoiding that implementation in some misguided attempt to make listening on :3128
easy - but the proposed approach is definitely much more flexible
Resolving rebase conflicts from main
was pointless, so dropped old commits and redid addressing PR comments
(very lightly) tested with default value (localhost:3128
), empty value (:3128
), and an arbitrary local IPv6 address
Server currently listens on
localhost:${port}
which is fine for most scenarios This adds the ability to optionally listen on:${port}
instead (all local IPs) It's unknown whether this has far reaching implications - very much included just as a jump off point for samuong/alpaca#95 if desiredPotentially addresses samuong/alpaca#95
NB: previous commits removed since it was a tiny change and clashed with recent merges