proxy-chain
proxy-chain copied to clipboard
Add ability to hijack requests
I want to be able to hijack the proxy traffic, mostly for reading but ideally also for writing.
I was thinking of implementing a way to return from prepareRequestFunction a method to handle a request/CONNECT stream instead of the default handling.
Something like this:
const server = new ProxyChain.Server({
port: 8080,
prepareRequestFunction({ hostname }) {
return {
connectTunnelHandler(sourceSocket) {
// proxy-chain won't open a target socket
}
};
},
});
Before working on it, I would like to get feedback to know if it's something welcomed. I know that the CONNECT traffic is encrypted but in cases where breaking the encryption is okay (like my own use case) it can be useful.
You can already do this, either return a static response with customResponseFunction or use a local web server as the upstream, and there you can do whatever you want.