which should alias to --allow-net=0.0.0.0:4500
This will require a bit more work - currently any address passed to allow-net has to match exactly address used in fetch/dial/listen, eg:
// example 1
$ deno --allow-net=localhost --no-prompt run script.ts
// this throws permission denied
await Deno.dial("127.0.0.1:8000");
// this throws permission denied as well
await Deno.dial("0.0.0.0:8000");
// this one works
await Deno.dial("localhost:8000");
// example 2
$ deno --allow-net=127.0.0.1 --no-prompt run script.ts
// script.ts
// this one works
await Deno.dial("127.0.0.1:8000");
// this one throws permission denied
await Deno.dial("localhost:8000");
// this throws permission denied as well
await Deno.dial("0.0.0.0:8000");
// example 3
$ deno --allow-net=0.0.0.0 --no-prompt run script.ts
// script.ts
// this one works
await Deno.dial("0.0.0.0:8000");
// this one throws permission denied
await Deno.dial("localhost:8000");
// this throws permission denied as well
await Deno.dial("127.0.0.1:8000");
Perhaps :8000 could expand to localhost:8000,0.0.0.0:8000,127.0.0.1:8000 ?
Perhaps --allow-net=0.0.0.0 should also allow 127.0.0.1 ?
We should be cautious about expanding something that is explicit already, it erodes the security module. --allow-net=0.0.0.0 binding also to 127.0.0.1 is sort of magical and surprising. I think something that is ambiguous like --allow-net=:4500 or --allow-net=:8000 allowing binding to all the suggested address is fine, but something explicit should stay explicit.
Most helpful comment
We should be cautious about expanding something that is explicit already, it erodes the security module.
--allow-net=0.0.0.0binding also to127.0.0.1is sort of magical and surprising. I think something that is ambiguous like--allow-net=:4500or--allow-net=:8000allowing binding to all the suggested address is fine, but something explicit should stay explicit.