diff options
Diffstat (limited to 'cli/tests/045_programmatic_proxy_client.ts')
-rw-r--r-- | cli/tests/045_programmatic_proxy_client.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/045_programmatic_proxy_client.ts b/cli/tests/045_programmatic_proxy_client.ts new file mode 100644 index 000000000..50884407d --- /dev/null +++ b/cli/tests/045_programmatic_proxy_client.ts @@ -0,0 +1,16 @@ +// Copyright 2018-2021 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/test_util/std/examples/colors.ts", + { client }, +); +console.log(`Response http: ${await res.text()}`); + +client.close(); |