dmy / elm-doc-preview

Elm offline documentation previewer
https://www.npmjs.com/package/elm-doc-preview
Other
128 stars 15 forks source link

Configurable binding address with loopback as default #52

Open knuton opened 2 years ago

knuton commented 2 years ago

Thanks for making this useful tool! :blush:

As far as I can tell the server currently binds to all IPs, which means that its contents may be accessible from a machine on the local network, which may or may not be wanted.

Would you be open to making the binding address configurable? Ideally this would default to the loopback address (127.0.0.1), though this behaviour may be considered a breaking change for existing users.

It could work like this:

$ elm-doc-preview # server only listens on 127.0.0.1:8000
$ elm-doc-preview --address 192.178.0.100 --port 9090 # server only listens on 192.178.0.100:9090
$ elm-doc-preview --address 0.0.0.0 # server listens on all IPs on port 8000

Would you be interested in a PR? Is a breaking change acceptable?