trys / sergey

A tiny lil' static site generator
https://sergey.trysmudford.com
MIT License
302 stars 39 forks source link

Running on 0.0.0.0 #51

Open mas-4 opened 4 years ago

mas-4 commented 4 years ago

Hi,

I was wondering if there is an option, or if it would be an enhancement, to run the dev server on 0.0.0.0? I tend to develop in PuTTy from a Windows machine which requires I run any dev servers on a network. I didn't see anything but the option to change the port in the options on the sergey.cool site.

This would be a massive help. Thanks.

mas-4 commented 4 years ago

Update: I did some investigation myself (figured the code couldn't be too challenging) and it appears that connect().listen() defaults to listen on any port (0.0.0.0). It would be fairly trivial to add a HOST parameter to your code if you'd prefer to actually default to localhost and allow people to specify the host if they would like 0.0.0.0. This might actually be considered a security risk.

I could write the PR if you'd like.

mas-4 commented 4 years ago

I already wrote it. Sorry if that seems a little forward.

https://github.com/trys/sergey/pull/52