mirror of
https://github.com/denoland/deno.git
synced 2024-12-28 01:59:06 -05:00
parent
aa21e7bc81
commit
af18093498
5 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
variables:
|
||||
DENO_VERSION: "v0.18.0"
|
||||
DENO_VERSION: "v0.19.0"
|
||||
TS_VERSION: "3.4.5"
|
||||
|
||||
# TODO Try to get eslint to run under Deno, like prettier
|
||||
|
|
|
@ -50,7 +50,7 @@ World 4
|
|||
test(async function serverPipelineRace(): Promise<void> {
|
||||
await startServer();
|
||||
|
||||
const conn = await dial("tcp", "127.0.0.1:4501");
|
||||
const conn = await dial({ port: 4501 });
|
||||
const r = new TextProtoReader(new BufReader(conn));
|
||||
await conn.write(new TextEncoder().encode(input));
|
||||
const outLines = output.split("\n");
|
||||
|
|
|
@ -386,7 +386,9 @@ export class Server implements AsyncIterable<ServerRequest> {
|
|||
}
|
||||
|
||||
export function serve(addr: string): Server {
|
||||
const listener = listen("tcp", addr);
|
||||
// TODO(ry) Update serve to also take { hostname, port }.
|
||||
const [hostname, port] = addr.split(":");
|
||||
const listener = listen({ hostname, port: Number(port) });
|
||||
return new Server(listener);
|
||||
}
|
||||
|
||||
|
|
|
@ -512,7 +512,7 @@ test({
|
|||
await delay(100);
|
||||
|
||||
// Reqeusts to the server and immediately closes the connection
|
||||
const conn = await Deno.dial("tcp", "127.0.0.1:4502");
|
||||
const conn = await Deno.dial({ port: 4502 });
|
||||
await conn.write(new TextEncoder().encode("GET / HTTP/1.0\n\n"));
|
||||
conn.close();
|
||||
|
||||
|
|
|
@ -488,7 +488,7 @@ export async function connectWebSocket(
|
|||
throw new Error("currently https/wss is not supported");
|
||||
}
|
||||
}
|
||||
const conn = await Deno.dial("tcp", `${hostname}:${port}`);
|
||||
const conn = await Deno.dial({ hostname, port: Number(port) });
|
||||
const bufWriter = new BufWriter(conn);
|
||||
const bufReader = new BufReader(conn);
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue