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

Commit 5f64fae

Browse files
committed
End Net 4.0 support
1 parent 87eb8c7 commit 5f64fae

9 files changed

+32
-118
lines changed

.build/default.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Task default -depends Clean, Build, Package
3939

4040
Task Build -depends Restore-Packages {
4141
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration }
42-
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration-Net45 }
4342
}
4443

4544
Task Package -depends Build {

Titanium.Web.Proxy.Test/ProxyTestController.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ namespace Titanium.Web.Proxy.Test
99
{
1010
public class ProxyTestController
1111
{
12-
13-
1412
public void StartProxy()
1513
{
1614
ProxyServer.BeforeRequest += OnRequest;
@@ -19,31 +17,33 @@ public void StartProxy()
1917
//Exclude Https addresses you don't want to proxy
2018
//Usefull for clients that use certificate pinning
2119
//for example dropbox.com
22-
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true){
23-
// ExcludedHttpsHostNameRegex = new List<string>() { "google.com", "dropbox.com" }
20+
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true)
21+
{
22+
// ExcludedHttpsHostNameRegex = new List<string>() { "google.com", "dropbox.com" }
2423
};
2524

2625
//An explicit endpoint is where the client knows about the existance of a proxy
2726
//So client sends request in a proxy friendly manner
2827
ProxyServer.AddEndPoint(explicitEndPoint);
2928
ProxyServer.Start();
3029

31-
30+
3231
//Transparent endpoint is usefull for reverse proxying (client is not aware of the existance of proxy)
3332
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets to this endpoint
3433
//Currently do not support Server Name Indication (It is not currently supported by SslStream class)
3534
//That means that the transparent endpoint will always provide the same Generic Certificate to all HTTPS requests
3635
//In this example only google.com will work for HTTPS requests
3736
//Other sites will receive a certificate mismatch warning on browser
3837
//Please read about it before asking questions!
39-
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 8001, true) {
38+
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 8001, true)
39+
{
4040
GenericCertificateName = "google.com"
41-
};
41+
};
4242
ProxyServer.AddEndPoint(transparentEndPoint);
43-
43+
4444

4545
foreach (var endPoint in ProxyServer.ProxyEndPoints)
46-
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ",
46+
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ",
4747
endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
4848

4949
//Only explicit proxies can be set as system proxy!
@@ -76,10 +76,10 @@ public void OnRequest(object sender, SessionEventArgs e)
7676

7777
//Get/Set request body as string
7878
string bodyString = e.GetRequestBodyAsString();
79-
e.SetRequestBodyString(bodyString);
79+
e.SetRequestBodyString(bodyString);
8080

8181
}
82-
82+
8383
//To cancel a request with a custom HTML content
8484
//Filter URL
8585
if (e.ProxySession.Request.RequestUri.AbsoluteUri.Contains("google.com"))

Titanium.Web.Proxy.Test/Titanium.Web.Proxy.Test.csproj

+5-27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,47 +18,25 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
21+
<DefineConstants>TRACE;DEBUG;NET45</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
24+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
2525
<Prefer32Bit>false</Prefer32Bit>
2626
</PropertyGroup>
2727
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2828
<DebugType>pdbonly</DebugType>
2929
<Optimize>true</Optimize>
3030
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE;NET40</DefineConstants>
31+
<DefineConstants>TRACE;NET45</DefineConstants>
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
34-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
34+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
3535
<Prefer32Bit>false</Prefer32Bit>
3636
</PropertyGroup>
3737
<PropertyGroup>
3838
<StartupObject />
3939
</PropertyGroup>
40-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU'">
41-
<DebugSymbols>true</DebugSymbols>
42-
<OutputPath>bin\Debug-Net45\</OutputPath>
43-
<DefineConstants>TRACE;DEBUG;NET45</DefineConstants>
44-
<DebugType>full</DebugType>
45-
<PlatformTarget>AnyCPU</PlatformTarget>
46-
<ErrorReport>prompt</ErrorReport>
47-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
48-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
49-
<Prefer32Bit>true</Prefer32Bit>
50-
</PropertyGroup>
51-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU'">
52-
<OutputPath>bin\Release-Net45\</OutputPath>
53-
<DefineConstants>TRACE;NET45</DefineConstants>
54-
<Optimize>true</Optimize>
55-
<DebugType>pdbonly</DebugType>
56-
<PlatformTarget>AnyCPU</PlatformTarget>
57-
<ErrorReport>prompt</ErrorReport>
58-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
59-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
60-
<Prefer32Bit>true</Prefer32Bit>
61-
</PropertyGroup>
6240
<ItemGroup>
6341
<Reference Include="System" />
6442
<Reference Include="System.ComponentModel.DataAnnotations" />

Titanium.Web.Proxy.sln

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B6DBABDC-C985-4872-9C38-B4E5079CBC4B}"
77
EndProject
@@ -19,27 +19,17 @@ EndProject
1919
Global
2020
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2121
Debug|Any CPU = Debug|Any CPU
22-
Debug-Net45|Any CPU = Debug-Net45|Any CPU
2322
Release|Any CPU = Release|Any CPU
24-
Release-Net45|Any CPU = Release-Net45|Any CPU
2523
EndGlobalSection
2624
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2725
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2826
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Debug|Any CPU.Build.0 = Debug|Any CPU
29-
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
30-
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
3127
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Release|Any CPU.ActiveCfg = Release|Any CPU
3228
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
34-
{F3B7E553-1904-4E80-BDC7-212342B5C952}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
3529
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3630
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
38-
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
3931
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Release|Any CPU.ActiveCfg = Release|Any CPU
4032
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
42-
{8D73A1BE-868C-42D2-9ECE-F32CC1A02906}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
4333
EndGlobalSection
4434
GlobalSection(SolutionProperties) = preSolution
4535
HideSolutionNode = FALSE

Titanium.Web.Proxy/Titanium.Web.Proxy.csproj

+6-51
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,26 @@
1313
<FileAlignment>512</FileAlignment>
1414
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1515
<RestorePackages>true</RestorePackages>
16+
<TargetFrameworkProfile />
1617
</PropertyGroup>
1718
<PropertyGroup>
1819
<StartupObject />
1920
</PropertyGroup>
2021
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
2122
<PlatformTarget>AnyCPU</PlatformTarget>
2223
<OutputPath>bin\Debug\</OutputPath>
23-
<DefineConstants>DEBUG;NET40</DefineConstants>
24-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
25-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
26-
</PropertyGroup>
27-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
28-
<PlatformTarget>AnyCPU</PlatformTarget>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
31-
<DefineConstants>NET40</DefineConstants>
32-
</PropertyGroup>
33-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU'">
34-
<DebugSymbols>true</DebugSymbols>
35-
<OutputPath>bin\Debug-Net45\</OutputPath>
3624
<DefineConstants>DEBUG;NET45</DefineConstants>
3725
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
38-
<PlatformTarget>AnyCPU</PlatformTarget>
39-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4026
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
27+
<Prefer32Bit>false</Prefer32Bit>
4128
</PropertyGroup>
42-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU'">
43-
<OutputPath>bin\Release-Net45\</OutputPath>
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
4430
<PlatformTarget>AnyCPU</PlatformTarget>
45-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
31+
<OutputPath>bin\Release\</OutputPath>
4632
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
4733
<DefineConstants>NET45</DefineConstants>
34+
<Prefer32Bit>false</Prefer32Bit>
4835
</PropertyGroup>
49-
<ItemGroup Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'">
50-
<Reference Include="Microsoft.Threading.Tasks">
51-
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
52-
</Reference>
53-
<Reference Include="Microsoft.Threading.Tasks.Extensions">
54-
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
55-
</Reference>
56-
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
57-
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
58-
</Reference>
59-
<Reference Include="System.IO">
60-
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll</HintPath>
61-
</Reference>
62-
<Reference Include="System.Runtime">
63-
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll</HintPath>
64-
</Reference>
65-
<Reference Include="System.Threading.Tasks">
66-
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll</HintPath>
67-
</Reference>
68-
</ItemGroup>
6936
<ItemGroup>
7037
<Reference Include="Ionic.Zip, Version=1.9.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
7138
<HintPath>..\packages\DotNetZip.1.9.8\lib\net20\Ionic.Zip.dll</HintPath>
@@ -119,14 +86,7 @@
11986
<ItemGroup />
12087
<ItemGroup>
12188
<None Include="app.config" />
122-
</ItemGroup>
123-
<ItemGroup Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'">
124-
<None Include="packages.config">
125-
<SubType>Designer</SubType>
126-
</None>
127-
</ItemGroup>
128-
<ItemGroup Condition="'$(Configuration)' == 'Debug-Net45' Or '$(Configuration)' == 'Release-Net45'">
129-
<None Include="packages-Net45.config" />
89+
<None Include="packages.config" />
13090
</ItemGroup>
13191
<ItemGroup>
13292
<None Include="makecert.exe">
@@ -141,11 +101,6 @@
141101
</PropertyGroup>
142102
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
143103
</Target>
144-
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
145-
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
146-
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
147-
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
148-
</Target>
149104
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
150105
Other similar extension points exist, see Microsoft.Common.targets.
151106
<Target Name="BeforeBuild">

Titanium.Web.Proxy/Titanium.Web.Proxy.nuspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</dependencies>
1919
</metadata>
2020
<files>
21-
<file src="bin\$configuration$\Titanium.Web.Proxy.dll" target="lib\net40" />
22-
<file src="bin\$configuration$-Net45\Titanium.Web.Proxy.dll" target="lib\net45" />
21+
<file src="bin\$configuration$\Titanium.Web.Proxy.dll" target="lib\net45" />
2322
<file src="bin\$configuration$\makecert.exe" target="content" />
2423
</files>
2524
</package>

Titanium.Web.Proxy/app.config

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
6+
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
10+
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0"/>
1212
</dependentAssembly>
1313
</assemblyBinding>
1414
</runtime>
15-
</configuration>
15+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

Titanium.Web.Proxy/packages-Net45.config

-4
This file was deleted.

Titanium.Web.Proxy/packages.config

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="DotNetZip" version="1.9.8" targetFramework="net40" />
4-
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net40" />
5-
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
6-
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
3+
<package id="DotNetZip" version="1.9.8" targetFramework="net45" />
74
</packages>

0 commit comments

Comments
 (0)