mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
10 lines
263 B
TypeScript
10 lines
263 B
TypeScript
|
import { args, listen, copy } from "deno";
|
||
|
const addr = args[1] || "127.0.0.1:4544";
|
||
|
const listener = listen("tcp", addr);
|
||
|
console.log("listening on", addr);
|
||
|
listener.accept().then(async conn => {
|
||
|
await copy(conn, conn);
|
||
|
conn.close();
|
||
|
listener.close();
|
||
|
});
|