private async Task onBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) { string hostname = e.HttpClient.Request.RequestUri.Host; e.GetState().PipelineInfo.AppendLine(nameof(onBeforeTunnelConnectRequest) + ":" + hostname); await writeToConsole("Tunnel to: " + hostname); if (hostname.Contains("dropbox.com")) { // Exclude Https addresses you don't want to proxy // Useful for clients that use certificate pinning // for example dropbox.com e.DecryptSsl = false; } }
private async Task onBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) { string hostname = e.HttpClient.Request.RequestUri.Host; e.GetState().PipelineInfo.AppendLine(nameof(onBeforeTunnelConnectRequest) + ":" + hostname); writeToConsole("Tunnel to: " + hostname); var clientLocalIp = e.ClientLocalEndPoint.Address; if (!clientLocalIp.Equals(IPAddress.Loopback) && !clientLocalIp.Equals(IPAddress.IPv6Loopback)) { e.HttpClient.UpStreamEndPoint = new IPEndPoint(clientLocalIp, 0); } if (hostname.Contains("dropbox.com")) { // Exclude Https addresses you don't want to proxy // Useful for clients that use certificate pinning // for example dropbox.com e.DecryptSsl = false; } }
private Task onBeforeTunnelConnectResponse(object sender, TunnelConnectSessionEventArgs e) { e.GetState().PipelineInfo.AppendLine(nameof(onBeforeTunnelConnectResponse) + ":" + e.HttpClient.Request.RequestUri); return(Task.CompletedTask); }