15 lines
296 B
TypeScript
15 lines
296 B
TypeScript
import { copy } from "https://deno.land/std@0.156.0/streams/conversion.ts";
|
|
|
|
const PORT = 5588;
|
|
|
|
console.log(`Listening on port ${PORT}`);
|
|
|
|
for await (const conn of Deno.listen({ port: PORT })) {
|
|
echo(conn);
|
|
}
|
|
|
|
async function echo(conn: Deno.Conn) {
|
|
await copy(conn, conn);
|
|
conn.close();
|
|
}
|