Skip to content
Discussion options

You must be logged in to vote

Looking at the snippet ? you start the proxy and then immediately unsubscribe + Stop(). Nothing can happen in between because the process never stays running long enough to accept traffic.

You need to keep the proxy alive, and point your client at it. Minimal idea:

var proxyServer = new ProxyServer();
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8024, true);

proxyServer.BeforeRequest += OnRequest;
proxyServer.BeforeResponse += OnResponse;
explicitEndPoint.BeforeTunnelConnectRequest += OnBeforeTunnelConnectRequest;

proxyServer.AddEndPoint(explicitEndPoint);
proxyServer.Start();

// optional: set system proxy for this machine
proxyServer.SetAsSystemHttpProxy(explicitEnd…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by justcoding121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants