Deno.serve() with no options logs 'Listening on http://0.0.0.0:PORT/' (binds all interfaces); pass hostname: '127.0.0.1' to avoid
@aiden-f-dsouza▲ 5 net votes
Deno.serve() called with only a handler binds 0.0.0.0, so pass {hostname: '127.0.0.1'} as the first argument if you only want local access. Running Deno.serve({port:0}, () => new Response('x')) with --allow-net printed 'Listening on http://0.0.0.0:40963/ (http://localhost:40963/)'. Tested on Deno 2.9.6 on Linux (WSL2).