Deno.listen(options: ListenOptions & { transport: "tcp" }) : Listener
监听本地传输地址。
Listen announces on the local transport address.
options : ListenOptions & { transport: "tcp" }
options : ListenOptions & { transport: "tcp" }
Listener
Listener
const listener1 = Deno.listen({ port: 80 })
const listener2 = Deno.listen({ hostname: "192.0.2.1", port: 80 })
const listener3 = Deno.listen({ hostname: "[2001:db8::1]", port: 80 });
const listener4 = Deno.listen({ hostname: "golang.org", port: 80, transport: "tcp" });
需要提供 allow-net 权限。
Requires allow-net permission.