Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"make-fetch-happen": "^16.0.1",
"needle": "^3.5.0",
"node-fetch": "^3.3.0",
"nvm": "^0.0.4",
"playwright": "^1.62.1",
"puppeteer": "^25.9.0",
"socks-proxy-agent": "^10.1.0",
Expand All @@ -28,6 +27,9 @@
"undici": "^8.10.1",
"wretch": "^3.0.9"
},
"overrides": {
"qs": "^6.16.0"
},
"keywords": [
"proxy",
"http",
Expand Down
9 changes: 5 additions & 4 deletions javascript/wretch-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* PROXY_URL - Proxy URL (required), e.g., http://user:pass@proxy:8080
* TEST_URL - URL to request (default: https://api.ipify.org?format=json)
*
* Registers node-fetch + HttpsProxyAgent as wretch’s fetch polyfill for Node.
* Registers node-fetch + HttpsProxyAgent via wretch’s per-instance fetchPolyfill (wretch 3).
*/
import wretch from 'wretch';
import fetch from 'node-fetch';
Expand Down Expand Up @@ -35,10 +35,11 @@ function boundFetch(input, init = {}) {
return fetch(input, { ...init, agent });
}

wretch.polyfills({ fetch: boundFetch });

try {
const response = await wretch(testUrl).get().res();
const response = await wretch(testUrl)
.fetchPolyfill(boundFetch)
.get()
.res();
const body = await response.text();

console.log(`Status: ${response.status}`);
Expand Down
4 changes: 2 additions & 2 deletions ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GEM
multi_xml (>= 0.5.2)
httpclient (2.9.0)
mutex_m
json (2.21.1)
json (2.21.2)
llhttp (0.6.2)
logger (1.7.0)
mechanize (2.14.1)
Expand Down Expand Up @@ -143,7 +143,7 @@ CHECKSUMS
http-cookie (1.1.6) sha256=ba4b82be64de61dc281243dac70e3c382c45142f20268ed9276a3670c93feaa9
httparty (0.24.2) sha256=8fca6a54aa0c4aa4303a0fd33e5e2156175d6a5334f714263b458abd7fda9c38
httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8
json (2.21.1) sha256=13a43df75d95641443f5702dff350f237164a9d811ff0f2c2800d4d980220583
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
llhttp (0.6.2) sha256=3c3c59aafb1e1594ab2f45293478f697458f5a91eb0f0db4b27f61a064024982
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
mechanize (2.14.1) sha256=b66205133a01d3dc3bc0cbc5e99888e5476818398d8d315193429f21488abafd
Expand Down