Skip to content

Instantly share code, notes, and snippets.

View mamannn's full-sized avatar

maman mamannn

View GitHub Profile
@mamannn
mamannn / package.json
Created March 15, 2023 14:49
package.json
{
"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"
@mamannn
mamannn / http2.js
Created March 15, 2023 14:45
http2
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,
},
@mamannn
mamannn / http1.js
Last active March 15, 2023 14:44
http1
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,