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

Commit f74219a

Browse files
authored
Merge pull request #900 from justcoding121/develop
beta
2 parents 9d759b1 + cfddda6 commit f74219a

22 files changed

+86
-175
lines changed

.build/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if($Branch -eq "beta" ) { $Version = "$Version-beta" }
2929

3030
$NuGet = Join-Path $RepoRoot ".nuget\nuget.exe"
3131

32-
$MSBuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe"
32+
$MSBuild = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\msbuild.exe"
3333
$MSBuild -replace ' ', '` '
3434

3535
FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ The owner of this project, [justcoding121](https://github.com/justcoding121), is
5151
### Development environment
5252

5353
#### Windows
54-
* Visual Studio Code as IDE for .NET Core
55-
* Visual Studio 2019 as IDE for .NET Framework/.NET Core
54+
* Visual Studio Code as IDE for .NET
55+
* Visual Studio 2022 as IDE for .NET Framework/.NET
5656

5757
#### Mac OS
58-
* Visual Studio Code as IDE for .NET Core
59-
* Visual Studio 2019 as IDE for Mono
58+
* Visual Studio Code as IDE for .NET
59+
* Visual Studio 2022 as IDE for Mono
6060

6161
#### Linux
62-
* Visual Studio Code as IDE for .NET Core
62+
* Visual Studio Code as IDE for .NET
6363
* Mono develop as IDE for Mono
6464

6565
### Usage
@@ -93,7 +93,7 @@ var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true)
9393
};
9494

9595
// Fired when a CONNECT request is received
96-
explicitEndPoint.BeforeTunnelConnect += OnBeforeTunnelConnect;
96+
explicitEndPoint.BeforeTunnelConnectRequest += OnBeforeTunnelConnectRequest;
9797

9898
// An explicit endpoint is where the client knows about the existence of a proxy
9999
// So client sends request in a proxy friendly manner
@@ -127,7 +127,7 @@ proxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
127127
Console.Read();
128128

129129
// Unsubscribe & Quit
130-
explicitEndPoint.BeforeTunnelConnect -= OnBeforeTunnelConnect;
130+
explicitEndPoint.BeforeTunnelConnectRequest -= OnBeforeTunnelConnectRequest;
131131
proxyServer.BeforeRequest -= OnRequest;
132132
proxyServer.BeforeResponse -= OnResponse;
133133
proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
@@ -158,7 +158,7 @@ public async Task OnRequest(object sender, SessionEventArgs e)
158158
Console.WriteLine(e.HttpClient.Request.Url);
159159

160160
// read request headers
161-
var requestHeaders = e.HttpClient.Request.RequestHeaders;
161+
var requestHeaders = e.HttpClient.Request.Headers;
162162

163163
var method = e.HttpClient.Request.Method.ToUpper();
164164
if ((method == "POST" || method == "PUT" || method == "PATCH"))
@@ -200,12 +200,12 @@ public async Task OnRequest(object sender, SessionEventArgs e)
200200
public async Task OnResponse(object sender, SessionEventArgs e)
201201
{
202202
// read response headers
203-
var responseHeaders = e.HttpClient.Response.ResponseHeaders;
203+
var responseHeaders = e.HttpClient.Response.Headers;
204204

205205
//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
206206
if (e.HttpClient.Request.Method == "GET" || e.HttpClient.Request.Method == "POST")
207207
{
208-
if (e.HttpClient.Response.ResponseStatusCode == "200")
208+
if (e.HttpClient.Response.StatusCode == 200)
209209
{
210210
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
211211
{

appveyor.yml

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

99
# version format
1010
version: 3.1.{build}
11-
image: Visual Studio 2019
11+
image: Visual Studio 2022
1212

1313
shallow_clone: false
1414

examples/Titanium.Web.Proxy.Examples.Basic/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

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

Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Lines changed: 0 additions & 18 deletions
This file was deleted.

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

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net461;net50</TargetFrameworks>
6-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
7-
<LangVersion>7.1</LangVersion>
5+
<TargetFrameworks>net48;net60</TargetFrameworks>
86
</PropertyGroup>
97

108
<PropertyGroup>

examples/Titanium.Web.Proxy.Examples.WindowsService/App.config

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<configSections>
4-
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5-
<section name="WindowsServiceExample.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
4+
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
5+
<section name="WindowsServiceExample.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
66
</sectionGroup>
77
</configSections>
88
<startup>
9-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
9+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
1010
</startup>
1111
<runtime>
1212
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1313
<dependentAssembly>
14-
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
14+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
1616
</dependentAssembly>
1717
<dependentAssembly>
18-
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
19-
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
18+
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
19+
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
2020
</dependentAssembly>
2121
<dependentAssembly>
22-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
23-
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
22+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
23+
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0"/>
2424
</dependentAssembly>
2525
</assemblyBinding>
2626
</runtime>

examples/Titanium.Web.Proxy.Examples.WindowsService/Properties/Settings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RuntimeIdentifier>win</RuntimeIdentifier>
99
<RootNamespace>WindowsServiceExample</RootNamespace>
1010
<AssemblyName>WindowsServiceExample</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>
@@ -29,6 +29,7 @@
2929
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3030
<UseApplicationTrust>false</UseApplicationTrust>
3131
<BootstrapperEnabled>true</BootstrapperEnabled>
32+
<TargetFrameworkProfile />
3233
</PropertyGroup>
3334
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3435
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -121,5 +122,8 @@
121122
<ItemGroup>
122123
<ProjectReference Include="..\..\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
123124
</ItemGroup>
125+
<ItemGroup>
126+
<Reference Include="System" />
127+
</ItemGroup>
124128
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
125129
</Project>

examples/Titanium.Web.Proxy.Examples.Wpf/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net461;net50-windows</TargetFrameworks>
5+
<TargetFrameworks>net48;net60-windows</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
</PropertyGroup>
88

9-
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
10-
<Reference Include="PresentationCore" />
11-
<Reference Include="PresentationFramework" />
12-
<Reference Include="WindowsBase" />
13-
</ItemGroup>
14-
159
<ItemGroup>
1610
<Compile Remove="Properties\AssemblyInfo.cs" />
1711
</ItemGroup>

src/Titanium.Web.Proxy/Certificates/Cache/DefaultCertificateDiskCache.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ private string getRootCertificateDirectory()
129129
assemblyLocation = Assembly.GetEntryAssembly().Location;
130130
}
131131

132+
#if NETSTANDARD2_1
133+
// single-file app returns string.Empty location
134+
if (assemblyLocation == string.Empty)
135+
{
136+
assemblyLocation = AppContext.BaseDirectory;
137+
}
138+
#endif
139+
132140
string path = Path.GetDirectoryName(assemblyLocation);
133141

134142
rootCertificatePath = path ?? throw new NullReferenceException();

0 commit comments

Comments
 (0)