summaryrefslogtreecommitdiff
path: root/tests/specs/run/045_proxy/programmatic_proxy_client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/run/045_proxy/programmatic_proxy_client.ts')
-rw-r--r--tests/specs/run/045_proxy/programmatic_proxy_client.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/specs/run/045_proxy/programmatic_proxy_client.ts b/tests/specs/run/045_proxy/programmatic_proxy_client.ts
new file mode 100644
index 000000000..73af590c7
--- /dev/null
+++ b/tests/specs/run/045_proxy/programmatic_proxy_client.ts
@@ -0,0 +1,16 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+const client = Deno.createHttpClient({
+ proxy: {
+ url: "http://localhost:4555",
+ basicAuth: { username: "username", password: "password" },
+ },
+});
+
+const res = await fetch(
+ "http://localhost:4545/run/045_mod.ts",
+ { client },
+);
+console.log(`Response http: ${await res.text()}`);
+
+client.close();