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

Commit 17abd9b

Browse files
authored
Merge pull request #711 from justcoding121/master
stable
2 parents 30b1823 + d21ea35 commit 17abd9b

33 files changed

+213
-139
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "NetCore|Debug|Basic Example",
66
"type": "coreclr",
77
"request": "launch",
8-
"program": "${workspaceRoot}/examples/Titanium.Web.Proxy.Examples.Basic/bin/Debug/netcoreapp2.0/Titanium.Web.Proxy.Examples.Basic.NetCore.dll",
8+
"program": "${workspaceRoot}/examples/Titanium.Web.Proxy.Examples.Basic/bin/Debug/netcoreapp3.1/Titanium.Web.Proxy.Examples.Basic.NetCore.dll",
99
"args": [],
1010
"cwd": "${workspaceRoot}",
1111
"stopAtEntry": false,
@@ -16,7 +16,7 @@
1616
"name": "NetCore|Release|Basic Example",
1717
"type": "coreclr",
1818
"request": "launch",
19-
"program": "${workspaceRoot}/examples/Titanium.Web.Proxy.Examples.Basic/bin/Release/netcoreapp2.0/Titanium.Web.Proxy.Examples.Basic.NetCore.dll",
19+
"program": "${workspaceRoot}/examples/Titanium.Web.Proxy.Examples.Basic/bin/Release/netcoreapp3.1/Titanium.Web.Proxy.Examples.Basic.NetCore.dll",
2020
"args": [],
2121
"cwd": "${workspaceRoot}",
2222
"stopAtEntry": false,

examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ private async Task onRequest(object sender, SessionEventArgs e)
207207
{
208208
e.GetState().PipelineInfo.AppendLine(nameof(onRequest) + ":" + e.HttpClient.Request.RequestUri);
209209

210+
var clientLocalIp = e.ClientLocalEndPoint.Address;
211+
if (!clientLocalIp.Equals(IPAddress.Loopback) && !clientLocalIp.Equals(IPAddress.IPv6Loopback))
212+
{
213+
e.HttpClient.UpStreamEndPoint = new IPEndPoint(clientLocalIp, 0);
214+
}
215+
216+
if (e.HttpClient.Request.Url.Contains("yahoo.com"))
217+
{
218+
e.CustomUpStreamProxy = new ExternalProxy("localhost", 8888);
219+
}
220+
210221
await writeToConsole("Active Client Connections:" + ((ProxyServer)sender).ClientConnectionCount);
211222
await writeToConsole(e.HttpClient.Request.Url);
212223

examples/Titanium.Web.Proxy.Examples.Basic/Titanium.Web.Proxy.Examples.Basic.NetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<LangVersion>7.1</LangVersion>
88
</PropertyGroup>

examples/Titanium.Web.Proxy.Examples.Basic/Titanium.Web.Proxy.Examples.Basic.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net461;netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<LangVersion>7.1</LangVersion>
88
</PropertyGroup>

examples/Titanium.Web.Proxy.Examples.WindowsService/Titanium.Web.Proxy.Examples.WindowsService.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@
103103
</ItemGroup>
104104
<ItemGroup>
105105
<PackageReference Include="Microsoft.Win32.Registry">
106-
<Version>4.6.0</Version>
106+
<Version>4.7.0</Version>
107107
</PackageReference>
108108
<PackageReference Include="System.Numerics.Vectors">
109109
<Version>4.5.0</Version>
110110
</PackageReference>
111111
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
112-
<Version>4.6.0</Version>
112+
<Version>4.7.0</Version>
113113
</PackageReference>
114114
<PackageReference Include="System.ServiceProcess.ServiceController">
115-
<Version>4.6.0</Version>
115+
<Version>4.7.0</Version>
116116
</PackageReference>
117117
<PackageReference Include="System.Threading.Tasks.Extensions">
118118
<Version>4.5.3</Version>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<GridViewColumn Header="Process" DisplayMemberBinding="{Binding Process}" />
3232
<GridViewColumn Header="SentBytes" DisplayMemberBinding="{Binding SentDataCount}" />
3333
<GridViewColumn Header="ReceivedBytes" DisplayMemberBinding="{Binding ReceivedDataCount}" />
34-
<GridViewColumn Header="ClientEndPoint" DisplayMemberBinding="{Binding ClientEndPoint}" />
34+
<GridViewColumn Header="ClientRemoteEndPoint" DisplayMemberBinding="{Binding ClientRemoteEndPoint}" />
3535
<GridViewColumn Header="ClientConnectionId" DisplayMemberBinding="{Binding ClientConnectionId}" />
3636
<GridViewColumn Header="ServerConnectionId" DisplayMemberBinding="{Binding ServerConnectionId}" />
3737
</GridView>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ private SessionListItem createSessionListItem(SessionEventArgsBase e)
229229
ClientConnectionId = e.ClientConnectionId,
230230
ServerConnectionId = e.ServerConnectionId,
231231
HttpClient = e.HttpClient,
232-
ClientEndPoint = e.ClientEndPoint,
232+
ClientRemoteEndPoint = e.ClientRemoteEndPoint,
233+
ClientLocalEndPoint = e.ClientLocalEndPoint,
233234
IsTunnelConnect = isTunnelConnect
234235
};
235236

examples/Titanium.Web.Proxy.Examples.Wpf/SessionListItem.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public Guid ServerConnectionId
3838

3939
public HttpWebClient HttpClient { get; set; }
4040

41-
public IPEndPoint ClientEndPoint { get; set; }
41+
public IPEndPoint ClientLocalEndPoint { get; set; }
42+
43+
public IPEndPoint ClientRemoteEndPoint { get; set; }
4244

4345
public bool IsTunnelConnect { get; set; }
4446

examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.NetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
</PropertyGroup>
88

examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net461;netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)