bun icon indicating copy to clipboard operation
bun copied to clipboard

Add `proxy` option to `fetch()`

Open Electroid opened this issue 2 years ago • 0 comments

This would be an optional parameter to fetch() that would allow you to define a proxy URL to route the request. This is similar to the http_proxy and https_proxy environment variables, except the proxy must be a fully-qualified URL instead of a host and port.

await fetch("http://example.com", {
  proxy: "http://localhost:8080/proxy"
});

Originally proposed by @alistaiir

Electroid avatar Jan 18 '23 19:01 Electroid