Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 0ea53fa

Browse files
committed
sample code updated
1 parent 6ea74ab commit 0ea53fa

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ public MainWindow()
115115

116116
private async Task ProxyServer_BeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
117117
{
118+
string hostname = e.WebSession.Request.RequestUri.Host;
119+
if (hostname.EndsWith("webex.com"))
120+
{
121+
e.Excluded = true;
122+
}
123+
118124
await Dispatcher.InvokeAsync(() =>
119125
{
120126
AddSession(e);

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,16 @@ Sample request and response event handlers
126126
private IDictionary<Guid, string> requestBodyHistory
127127
= new ConcurrentDictionary<Guid, string>();
128128

129-
private async Task<bool> OnBeforeTunnelConnect(string hostname)
129+
private async Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
130130
{
131+
string hostname = e.WebSession.Request.RequestUri.Host;
132+
131133
if (hostname.Contains("dropbox.com"))
132134
{
133135
//Exclude Https addresses you don't want to proxy
134136
//Useful for clients that use certificate pinning
135137
//for example dropbox.com
136-
return await Task.FromResult(true);
137-
}
138-
else
139-
{
140-
return await Task.FromResult(false);
138+
e.Excluded = true;
141139
}
142140
}
143141

0 commit comments

Comments
 (0)