1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/examples/echo_server.ts
2019-02-07 11:45:47 -05:00

12 lines
327 B
TypeScript

// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { listen, copy } from "deno";
(async () => {
const addr = "0.0.0.0:8080";
const listener = listen("tcp", addr);
console.log("listening on", addr);
while (true) {
const conn = await listener.accept();
copy(conn, conn);
}
})();