summaryrefslogtreecommitdiff
path: root/tests/specs/run/045_proxy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/run/045_proxy')
-rw-r--r--tests/specs/run/045_proxy/proxy_test.ts8
-rw-r--r--tests/specs/run/045_proxy/proxy_test.ts.out2
2 files changed, 3 insertions, 7 deletions
diff --git a/tests/specs/run/045_proxy/proxy_test.ts b/tests/specs/run/045_proxy/proxy_test.ts
index d04356930..70781f97d 100644
--- a/tests/specs/run/045_proxy/proxy_test.ts
+++ b/tests/specs/run/045_proxy/proxy_test.ts
@@ -1,14 +1,10 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { Server } from "@std/http/server.ts";
-
const addr = Deno.args[1] || "localhost:4555";
-async function proxyServer() {
+function proxyServer() {
const [hostname, p] = addr.split(":");
const port = parseInt(p ?? 4555);
- const server = new Server({ hostname, port, handler });
- console.log(`Proxy server listening on http://${addr}/`);
- await server.listenAndServe();
+ Deno.serve({ hostname, port }, handler);
}
async function handler(req: Request): Promise<Response> {
diff --git a/tests/specs/run/045_proxy/proxy_test.ts.out b/tests/specs/run/045_proxy/proxy_test.ts.out
index a1e567a14..39cb8779a 100644
--- a/tests/specs/run/045_proxy/proxy_test.ts.out
+++ b/tests/specs/run/045_proxy/proxy_test.ts.out
@@ -1,4 +1,4 @@
-Proxy server listening on [WILDCARD]
+Listening on [WILDCARD]
Proxy request to: http://localhost:4545/run/045_mod.ts
Proxy request to: http://localhost:4545/run/045_mod.ts
Proxy request to: http://localhost:4545/run/045_output.ts