Skip to content

Commit

Permalink
Merge pull request justcoding121#900 from justcoding121/develop
Browse files Browse the repository at this point in the history
beta
  • Loading branch information
honfika authored Jan 28, 2022
2 parents 9d759b1 + cfddda6 commit f74219a
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if($Branch -eq "beta" ) { $Version = "$Version-beta" }

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

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

FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ The owner of this project, [justcoding121](https://github.com/justcoding121), is
### Development environment

#### Windows
* Visual Studio Code as IDE for .NET Core
* Visual Studio 2019 as IDE for .NET Framework/.NET Core
* Visual Studio Code as IDE for .NET
* Visual Studio 2022 as IDE for .NET Framework/.NET

#### Mac OS
* Visual Studio Code as IDE for .NET Core
* Visual Studio 2019 as IDE for Mono
* Visual Studio Code as IDE for .NET
* Visual Studio 2022 as IDE for Mono

#### Linux
* Visual Studio Code as IDE for .NET Core
* Visual Studio Code as IDE for .NET
* Mono develop as IDE for Mono

### Usage
Expand Down Expand Up @@ -93,7 +93,7 @@ var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true)
};

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

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

// Unsubscribe & Quit
explicitEndPoint.BeforeTunnelConnect -= OnBeforeTunnelConnect;
explicitEndPoint.BeforeTunnelConnectRequest -= OnBeforeTunnelConnectRequest;
proxyServer.BeforeRequest -= OnRequest;
proxyServer.BeforeResponse -= OnResponse;
proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
Expand Down Expand Up @@ -158,7 +158,7 @@ public async Task OnRequest(object sender, SessionEventArgs e)
Console.WriteLine(e.HttpClient.Request.Url);

// read request headers
var requestHeaders = e.HttpClient.Request.RequestHeaders;
var requestHeaders = e.HttpClient.Request.Headers;

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

//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
if (e.HttpClient.Request.Method == "GET" || e.HttpClient.Request.Method == "POST")
{
if (e.HttpClient.Response.ResponseStatusCode == "200")
if (e.HttpClient.Response.StatusCode == 200)
{
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
{
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# version format
version: 3.1.{build}
image: Visual Studio 2019
image: Visual Studio 2022

shallow_clone: false

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net50</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>7.1</LangVersion>
<TargetFrameworks>net48;net60</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
18 changes: 9 additions & 9 deletions examples/Titanium.Web.Proxy.Examples.WindowsService/App.config
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WindowsServiceExample.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="WindowsServiceExample.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RuntimeIdentifier>win</RuntimeIdentifier>
<RootNamespace>WindowsServiceExample</RootNamespace>
<AssemblyName>WindowsServiceExample</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
Expand All @@ -29,6 +29,7 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -121,5 +122,8 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net461;net50-windows</TargetFrameworks>
<TargetFrameworks>net48;net60-windows</TargetFrameworks>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ private string getRootCertificateDirectory()
assemblyLocation = Assembly.GetEntryAssembly().Location;
}

#if NETSTANDARD2_1
// single-file app returns string.Empty location
if (assemblyLocation == string.Empty)
{
assemblyLocation = AppContext.BaseDirectory;
}
#endif

string path = Path.GetDirectoryName(assemblyLocation);

rootCertificatePath = path ?? throw new NullReferenceException();
Expand Down
Loading

0 comments on commit f74219a

Please sign in to comment.