emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.36k stars 3.25k forks source link

run emrun on localhost / 127.0.0.1 by default #22077

Open kolAflash opened 3 weeks ago

kolAflash commented 3 weeks ago

Currently emrun filename.html listens to 0.0.0.0. Instead it should listen to localhost / 127.0.0.1 by default. (checked version 3.1.46)

For security reasons debugging and testing tools like emrun should not listen to possibly publicly reachable addresses.
Yes, there might be a firewall protecting public addresses. But it's better to pick safe defaults. _(Yes, even the localhost address isn't extremly safe. But that will hopefully change soon)_

In case it's needed emrun already has a --hostname switch where you can manually set 0.0.0.0 to listen on all addresses.

sbc100 commented 3 weeks ago

Seems reasonable to me. @juj WDYT? @kolAflash would you like to send a PR? (Please add a ChangeLog entry if you do)