Commit 0ea53fab authored by Honfika's avatar Honfika

sample code updated

parent 6ea74abc
...@@ -115,6 +115,12 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -115,6 +115,12 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private async Task ProxyServer_BeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) private async Task ProxyServer_BeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
{ {
string hostname = e.WebSession.Request.RequestUri.Host;
if (hostname.EndsWith("webex.com"))
{
e.Excluded = true;
}
await Dispatcher.InvokeAsync(() => await Dispatcher.InvokeAsync(() =>
{ {
AddSession(e); AddSession(e);
......
...@@ -126,18 +126,16 @@ Sample request and response event handlers ...@@ -126,18 +126,16 @@ Sample request and response event handlers
private IDictionary<Guid, string> requestBodyHistory private IDictionary<Guid, string> requestBodyHistory
= new ConcurrentDictionary<Guid, string>(); = new ConcurrentDictionary<Guid, string>();
private async Task<bool> OnBeforeTunnelConnect(string hostname) private async Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
{ {
string hostname = e.WebSession.Request.RequestUri.Host;
if (hostname.Contains("dropbox.com")) if (hostname.Contains("dropbox.com"))
{ {
//Exclude Https addresses you don't want to proxy //Exclude Https addresses you don't want to proxy
//Useful for clients that use certificate pinning //Useful for clients that use certificate pinning
//for example dropbox.com //for example dropbox.com
return await Task.FromResult(true); e.Excluded = true;
}
else
{
return await Task.FromResult(false);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment