bun icon indicating copy to clipboard operation
bun copied to clipboard

Add proxy option to fetch()

Open sumchattering opened this issue 2 years ago • 2 comments

sumchattering avatar Jan 20 '23 16:01 sumchattering

Hi @Jarred-Sumner.

Please accept my PR to add the proxy option to the fetch call.

One question I have is how to handle the scenario when proxy is http but the url is https. I am assuming this wont work as I imagine that an https url requires an https proxy. Should it throw an error in that scenario?

One other possiblilty is that we forcefully change the scheme of the proxy url to match the request url :)

Cheers. Sumeru

sumchattering avatar Jan 20 '23 16:01 sumchattering

Also I wanna add tests for this but to do that I would have to create a proxy server in the test itself which seems a bit overkill. Whats your opinion on whether we need tests for this feature?

sumchattering avatar Jan 20 '23 17:01 sumchattering