bun
bun copied to clipboard
Add `proxy` option to `fetch()`
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