potahtml / mpa-archive

Crawls a Multi-Page Application to a zip file, serve the Multi-Page Application from the zip file. A MPA archiver. Could be used as a Site Generator. Written for https://pota.quack.uy/
https://pota.quack.uy/
MIT License
470 stars 11 forks source link

Non-random localhost port #4

Open MitPitt opened 3 months ago

MitPitt commented 3 months ago

Serving the saved zips is easy with a reverse proxy like caddy.

But it seems to give apps random ports on run. If I could predefine these, that would be nice.

titoBouzout commented 3 months ago

The port is random but was seeded to the full path, I just changed it to be seeded to the zip filename instead, so it becomes more predictable. Would that work for you?

Also, the address is bind to 0.0.0.0 instead of localhost (which can still be opened in localhost)

MitPitt commented 3 months ago

Got it thanks. Full path or filename is ok.

Actually now that you mention it, I need it on localhost only and not 0.0.0.0. Because I intend to use a login thing in my reverse proxy, which won't protect my app if people can bypass it using <server's ip address>:<port> instead of going via the reverse proxy (e.g. example.com).