Skip to content

Add ability to hijack requests #622

@yotamN

Description

@yotamN

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions