Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Al Muntasir Abir amabirbd

🎯
Focusing
  • Keraniganj, Dhaka
View GitHub Profile
@amabirbd
amabirbd / gist:b84ca52c9eb5d9d3b2b3d4cb5c0e39cb
Created Apr 10, 2022
Forwarding proxy with nodeJS proxy
View gist:b84ca52c9eb5d9d3b2b3d4cb5c0e39cb
const net = require("net");
const server = net.createServer();
// Listening to connection event
server.on("connection", (ClientToProxySocket) => {
console.log("Client connected to the proxy");
ClientToProxySocket.once("data", (data) => {
//checking if connection is HTTP or HTTPS
let isTLSConnection = data.toString().indexOf("CONNECT") !== -1;