1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-02 09:34:19 -04:00
denoland-deno/std/examples/echo_server.ts
2019-10-09 17:10:09 -04:00

9 lines
303 B
TypeScript

// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
const hostname = "0.0.0.0";
const port = 8080;
const listener = Deno.listen({ hostname, port });
console.log(`Listening on ${hostname}:${port}`);
while (true) {
const conn = await listener.accept();
Deno.copy(conn, conn);
}