This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "proxy", | |
"version": "1.0.0", | |
"private": true, | |
"type": "module", | |
"main": "index.js", | |
"dependencies": { | |
"got": "^12.6.0", | |
"hpagent": "^1.2.0", | |
"http2-wrapper": "^2.2.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import got from "got"; | |
import http2 from "http2-wrapper"; | |
const httpsProxy = new http2.proxies.Http2OverHttp({ | |
proxyOptions: { | |
url: "http://localhost:3128", | |
// For demo purposes only! | |
rejectUnauthorized: false, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import got from "got"; | |
import hpagent from "hpagent"; | |
const proxy = "http://127.0.0.1:3128"; | |
const agent = { | |
http: new hpagent.HttpProxyAgent({ | |
proxy, | |
keepAlive: true, | |
keepAliveMsecs: 1000, |