Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
d0a7738b
Unverified
Commit
d0a7738b
authored
Oct 05, 2019
by
honfika
Committed by
GitHub
Oct 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #639 from justcoding121/master
beta
parents
c83769b5
299d4bad
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
105 additions
and
103 deletions
+105
-103
build.ps1
.build/build.ps1
+1
-1
appveyor.yml
appveyor.yml
+1
-1
Titanium.Web.Proxy.Examples.Wpf.csproj
...Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
+3
-30
Titanium.Web.Proxy.sln
src/Titanium.Web.Proxy.sln
+2
-1
ExplicitClientHandler.cs
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
+4
-7
SslExtensions.cs
src/Titanium.Web.Proxy/Extensions/SslExtensions.cs
+2
-2
HttpHelper.cs
src/Titanium.Web.Proxy/Helpers/HttpHelper.cs
+21
-13
Http2Helper.cs
src/Titanium.Web.Proxy/Http2/Http2Helper.cs
+19
-14
TcpClientConnection.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs
+1
-1
TcpConnectionFactory.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+1
-1
TcpServerConnection.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs
+1
-1
ProxyServer.cs
src/Titanium.Web.Proxy/ProxyServer.cs
+1
-0
RequestHandler.cs
src/Titanium.Web.Proxy/RequestHandler.cs
+7
-7
ResponseHandler.cs
src/Titanium.Web.Proxy/ResponseHandler.cs
+3
-3
Titanium.Web.Proxy.NetCore.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.NetCore.csproj
+4
-4
Titanium.Web.Proxy.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
+14
-5
Titanium.Web.Proxy.nuspec
src/Titanium.Web.Proxy/Titanium.Web.Proxy.nuspec
+12
-4
WebSocketHandler.cs
src/Titanium.Web.Proxy/WebSocketHandler.cs
+1
-1
Titanium.Web.Proxy.IntegrationTests.csproj
...tegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj
+4
-4
Titanium.Web.Proxy.UnitTests.csproj
...m.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj
+3
-3
No files found.
.build/build.ps1
View file @
d0a7738b
...
...
@@ -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\201
7\Community\MSBuild\15.0
\Bin\msbuild.exe"
$MSBuild
=
"
${
env
:ProgramFiles
(x86)
}
\Microsoft Visual Studio\201
9\Community\MSBuild\Current
\Bin\msbuild.exe"
$MSBuild
-replace
' '
,
'` '
FormatTaskName
((
"-"
*
25
)
+
"[{0}]"
+
(
"-"
*
25
))
...
...
appveyor.yml
View file @
d0a7738b
...
...
@@ -8,7 +8,7 @@
# version format
version
:
3.1.{build}
image
:
Visual Studio 201
7
image
:
Visual Studio 201
9
shallow_clone
:
false
...
...
examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
View file @
d0a7738b
...
...
@@ -6,11 +6,11 @@
<UseWPF>true</UseWPF>
</PropertyGroup>
<
!--<ItemGroup
>
<
ItemGroup Condition="'$(TargetFramework)' == 'net461'"
>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
</ItemGroup>
-->
</ItemGroup>
<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
...
...
@@ -20,23 +20,6 @@
<ProjectReference Include="..\..\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
</ItemGroup>
<!--<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Update="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Update="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
...
...
@@ -52,16 +35,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Update="App.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
<None Update="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>-->
</ItemGroup>
</Project>
\ No newline at end of file
src/Titanium.Web.Proxy.sln
View file @
d0a7738b
...
...
@@ -68,6 +68,7 @@ Global
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Debug|x64.ActiveCfg = Debug|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Debug|x64.Build.0 = Debug|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|Any CPU.Build.0 = Release|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|x64.ActiveCfg = Release|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|x64.Build.0 = Release|Any CPU
{1D053D72-DCB4-4517-ACDD-D35ADC186950}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
...
...
@@ -89,7 +90,7 @@ Global
{1D053D72-DCB4-4517-ACDD-D35ADC186950} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {625C1EB5-44CF-47DE-A85A-B4C8C40ED90A}
EnterpriseLibraryConfigurationToolBinariesPath = .1.505.2\lib\NET35
SolutionGuid = {625C1EB5-44CF-47DE-A85A-B4C8C40ED90A}
EndGlobalSection
EndGlobal
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
d0a7738b
...
...
@@ -288,8 +288,7 @@ namespace Titanium.Web.Proxy
if
(!
clientStream
.
IsClosed
&&
!
connection
.
Stream
.
IsClosed
)
{
await
TcpHelper
.
SendRaw
(
clientStream
,
connection
.
Stream
,
BufferPool
,
null
,
null
,
connectArgs
.
CancellationTokenSource
,
ExceptionFunc
);
null
,
null
,
connectArgs
.
CancellationTokenSource
,
ExceptionFunc
);
}
}
finally
...
...
@@ -338,17 +337,15 @@ namespace Titanium.Web.Proxy
await
connection
.
StreamWriter
.
WriteLineAsync
(
"SM"
,
cancellationToken
);
await
connection
.
StreamWriter
.
WriteLineAsync
(
cancellationToken
);
#if NETCOREAPP2_1
await
Http2Helper
.
SendHttp2
(
clientStream
,
connection
.
Stream
,
BufferPool
.
BufferSize
,
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDecryptedDataSent
(
buffer
,
offset
,
count
);
},
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDecryptedDataReceived
(
buffer
,
offset
,
count
);
},
await
Http2Helper
.
SendHttp2
(
clientStream
,
connection
.
Stream
,
()
=>
new
SessionEventArgs
(
this
,
endPoint
,
cancellationTokenSource
)
{
ProxyClient
=
{
Connection
=
clientConnection
},
HttpClient
=
{
ConnectRequest
=
connectArgs
?.
HttpClient
.
ConnectRequest
},
UserData
=
connectArgs
?.
UserData
},
async
args
=>
{
await
invoke
BeforeRequest
(
args
);
},
async
args
=>
{
await
invoke
BeforeResponse
(
args
);
},
async
args
=>
{
await
on
BeforeRequest
(
args
);
},
async
args
=>
{
await
on
BeforeResponse
(
args
);
},
connectArgs
.
CancellationTokenSource
,
clientConnection
.
Id
,
ExceptionFunc
);
#endif
}
...
...
src/Titanium.Web.Proxy/Extensions/SslExtensions.cs
View file @
d0a7738b
...
...
@@ -28,7 +28,7 @@ namespace Titanium.Web.Proxy.Extensions
return
null
;
}
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
internal
static
List
<
SslApplicationProtocol
>
GetAlpn
(
this
ClientHelloInfo
clientHelloInfo
)
{
if
(
clientHelloInfo
.
Extensions
!=
null
&&
clientHelloInfo
.
Extensions
.
TryGetValue
(
"ALPN"
,
out
var
alpnExtension
))
...
...
@@ -78,7 +78,7 @@ namespace Titanium.Web.Proxy.Extensions
#endif
}
#if !NETCOREAPP2_1
#if !NETCOREAPP2_1
&& !NETSTANDARD2_1
internal
enum
SslApplicationProtocol
{
Http11
,
...
...
src/Titanium.Web.Proxy/Helpers/HttpHelper.cs
View file @
d0a7738b
...
...
@@ -151,20 +151,28 @@ namespace Titanium.Web.Proxy.Helpers
/// </returns>
private
static
async
Task
<
int
>
startsWith
(
ICustomStreamReader
clientStreamReader
,
IBufferPool
bufferPool
,
string
expectedStart
,
CancellationToken
cancellationToken
=
default
)
{
int
iRet
=
-
1
;
const
int
lengthToCheck
=
10
;
byte
[]
buffer
=
null
;
try
{
buffer
=
bufferPool
.
GetBuffer
(
Math
.
Max
(
bufferPool
.
BufferSize
,
lengthToCheck
));
if
(
bufferPool
.
BufferSize
<
lengthToCheck
)
{
throw
new
Exception
(
$"Buffer is too small. Minimum size is
{
lengthToCheck
}
bytes"
);
}
int
peeked
=
await
clientStreamReader
.
PeekBytesAsync
(
buffer
,
0
,
0
,
lengthToCheck
,
cancellationToken
);
buffer
=
bufferPool
.
GetBuffer
(
bufferPool
.
BufferSize
);
if
(
peeked
>
0
)
bool
isExpected
=
true
;
int
i
=
0
;
while
(
i
<
lengthToCheck
)
{
bool
isExpected
=
true
;
int
peeked
=
await
clientStreamReader
.
PeekBytesAsync
(
buffer
,
i
,
i
,
lengthToCheck
-
i
,
cancellationToken
);
if
(
peeked
==
0
)
return
-
1
;
peeked
+=
i
;
for
(
int
i
=
0
;
i
<
lengthToCheck
;
i
++
)
while
(
i
<
peeked
)
{
int
b
=
buffer
[
i
];
...
...
@@ -173,23 +181,23 @@ namespace Titanium.Web.Proxy.Helpers
else
{
char
ch
=
(
char
)
b
;
if
(
!
char
.
IsLetter
(
ch
))
if
(
ch
<
'A'
||
ch
>
'z'
||
(
ch
>
'Z'
&&
ch
<
'a'
))
// ASCII letter
return
-
1
;
else
if
(
i
>=
expectedStart
.
Length
||
ch
!=
expectedStart
[
i
])
isExpected
=
false
;
isExpected
=
false
;
}
}
// only letters
iRet
=
isExpected
?
1
:
0
;
i
++;
}
}
// only letters
return
0
;
}
finally
{
bufferPool
.
ReturnBuffer
(
buffer
);
buffer
=
null
;
}
return
iRet
;
}
}
}
src/Titanium.Web.Proxy/Http2/Http2Helper.cs
View file @
d0a7738b
#
if
NETCOREAPP2_1
#
if
NETCOREAPP2_1
||
NETSTANDARD2_1
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
...
...
@@ -24,8 +24,7 @@ namespace Titanium.Web.Proxy.Http2
/// Task-based Asynchronous Pattern
/// </summary>
/// <returns></returns>
internal
static
async
Task
SendHttp2
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
internal
static
async
Task
SendHttp2
(
Stream
clientStream
,
Stream
serverStream
,
Func
<
SessionEventArgs
>
sessionFactory
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequest
,
Func
<
SessionEventArgs
,
Task
>
onBeforeResponse
,
CancellationTokenSource
cancellationTokenSource
,
Guid
connectionId
,
...
...
@@ -38,13 +37,13 @@ namespace Titanium.Web.Proxy.Http2
// Now async relay all server=>client & client=>server data
var
sendRelay
=
copyHttp2FrameAsync
(
clientStream
,
serverStream
,
onDataSend
,
clientSettings
,
serverSettings
,
copyHttp2FrameAsync
(
clientStream
,
serverStream
,
clientSettings
,
serverSettings
,
sessionFactory
,
sessions
,
onBeforeRequest
,
bufferSize
,
connectionId
,
true
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
connectionId
,
true
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
var
receiveRelay
=
copyHttp2FrameAsync
(
serverStream
,
clientStream
,
onDataReceive
,
serverSettings
,
clientSettings
,
copyHttp2FrameAsync
(
serverStream
,
clientStream
,
serverSettings
,
clientSettings
,
sessionFactory
,
sessions
,
onBeforeResponse
,
bufferSize
,
connectionId
,
false
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
connectionId
,
false
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
await
Task
.
WhenAny
(
sendRelay
,
receiveRelay
);
cancellationTokenSource
.
Cancel
();
...
...
@@ -52,11 +51,11 @@ namespace Titanium.Web.Proxy.Http2
await
Task
.
WhenAll
(
sendRelay
,
receiveRelay
);
}
private
static
async
Task
copyHttp2FrameAsync
(
Stream
input
,
Stream
output
,
Action
<
byte
[],
int
,
int
>
onCopy
,
private
static
async
Task
copyHttp2FrameAsync
(
Stream
input
,
Stream
output
,
Http2Settings
localSettings
,
Http2Settings
remoteSettings
,
Func
<
SessionEventArgs
>
sessionFactory
,
ConcurrentDictionary
<
int
,
SessionEventArgs
>
sessions
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequestResponse
,
int
bufferSize
,
Guid
connectionId
,
bool
isClient
,
CancellationToken
cancellationToken
,
Guid
connectionId
,
bool
isClient
,
CancellationToken
cancellationToken
,
ExceptionHandler
exceptionFunc
)
{
int
headerTableSize
=
0
;
...
...
@@ -69,7 +68,6 @@ namespace Titanium.Web.Proxy.Http2
{
var
frameHeaderBuffer
=
frameHeader
.
Buffer
;
int
read
=
await
forceRead
(
input
,
frameHeaderBuffer
,
0
,
9
,
cancellationToken
);
onCopy
(
frameHeaderBuffer
,
0
,
read
);
if
(
read
!=
9
)
{
return
;
...
...
@@ -92,7 +90,6 @@ namespace Titanium.Web.Proxy.Http2
}
read
=
await
forceRead
(
input
,
buffer
,
0
,
length
,
cancellationToken
);
onCopy
(
buffer
,
0
,
read
);
if
(
read
!=
length
)
{
return
;
...
...
@@ -127,6 +124,11 @@ namespace Titanium.Web.Proxy.Http2
//System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type);
if
(
type
==
Http2FrameType
.
Data
&&
args
!=
null
)
{
if
(
isClient
)
args
.
OnDataSent
(
buffer
,
0
,
read
);
else
args
.
OnDataReceived
(
buffer
,
0
,
read
);
rr
=
isClient
?
(
RequestResponseBase
)
args
.
HttpClient
.
Request
:
args
.
HttpClient
.
Response
;
bool
padded
=
(
flags
&
Http2FrameFlag
.
Padded
)
!=
0
;
...
...
@@ -182,8 +184,10 @@ namespace Titanium.Web.Proxy.Http2
{
args
=
sessionFactory
();
args
.
IsPromise
=
true
;
sessions
.
TryAdd
(
streamId
,
args
);
sessions
.
TryAdd
(
promisedStreamId
,
args
);
if
(!
sessions
.
TryAdd
(
streamId
,
args
))
;
if
(!
sessions
.
TryAdd
(
promisedStreamId
,
args
))
;
}
System
.
Diagnostics
.
Debug
.
WriteLine
(
"PROMISE STREAM: "
+
streamId
+
", "
+
promisedStreamId
+
...
...
@@ -201,7 +205,8 @@ namespace Titanium.Web.Proxy.Http2
if
(!
sessions
.
TryGetValue
(
streamId
,
out
args
))
{
args
=
sessionFactory
();
sessions
.
TryAdd
(
streamId
,
args
);
if
(!
sessions
.
TryAdd
(
streamId
,
args
))
;
}
rr
=
isClient
?
(
RequestResponseBase
)
args
.
HttpClient
.
Request
:
args
.
HttpClient
.
Response
;
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs
View file @
d0a7738b
using
System
;
using
System.IO
;
using
System.Net
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
#endif
using
System.Net.Sockets
;
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
d0a7738b
...
...
@@ -391,7 +391,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
CertificateRevocationCheckMode
=
proxyServer
.
CheckCertificateRevocation
};
await
sslStream
.
AuthenticateAsClientAsync
(
options
,
cancellationToken
);
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
negotiatedApplicationProtocol
=
sslStream
.
NegotiatedApplicationProtocol
;
#endif
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs
View file @
d0a7738b
using
System
;
using
System.Net
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
#endif
using
System.Net.Sockets
;
...
...
src/Titanium.Web.Proxy/ProxyServer.cs
View file @
d0a7738b
...
...
@@ -235,6 +235,7 @@ namespace Titanium.Web.Proxy
/// The buffer pool used throughout this proxy instance.
/// Set custom implementations by implementing this interface.
/// By default this uses DefaultBufferPool implementation available in StreamExtended library package.
/// Buffer size should be at least 10 bytes.
/// </summary>
public
IBufferPool
BufferPool
{
get
;
set
;
}
...
...
src/Titanium.Web.Proxy/RequestHandler.cs
View file @
d0a7738b
...
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Net
;
using
System.Net.Sockets
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
#endif
using
System.Text.RegularExpressions
;
...
...
@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy
// proxy authorization check
if
(
httpsConnectHostname
==
null
&&
await
checkAuthorization
(
args
)
==
false
)
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
// send the response
await
clientStreamWriter
.
WriteResponseAsync
(
args
.
HttpClient
.
Response
,
...
...
@@ -166,10 +166,8 @@ namespace Titanium.Web.Proxy
// we need this to syphon out data from connection if API user changes them.
request
.
SetOriginalHeaders
();
args
.
TimeLine
[
"Request Received"
]
=
DateTime
.
Now
;
// If user requested interception do it
await
invoke
BeforeRequest
(
args
);
await
on
BeforeRequest
(
args
);
var
response
=
args
.
HttpClient
.
Response
;
...
...
@@ -286,7 +284,7 @@ namespace Titanium.Web.Proxy
}
finally
{
await
invoke
AfterResponse
(
args
);
await
on
AfterResponse
(
args
);
args
.
Dispose
();
}
}
...
...
@@ -410,8 +408,10 @@ namespace Titanium.Web.Proxy
/// </summary>
/// <param name="args">The session event arguments.</param>
/// <returns></returns>
private
async
Task
invoke
BeforeRequest
(
SessionEventArgs
args
)
private
async
Task
on
BeforeRequest
(
SessionEventArgs
args
)
{
args
.
TimeLine
[
"Request Received"
]
=
DateTime
.
Now
;
if
(
BeforeRequest
!=
null
)
{
await
BeforeRequest
.
InvokeAsync
(
this
,
args
,
ExceptionFunc
);
...
...
src/Titanium.Web.Proxy/ResponseHandler.cs
View file @
d0a7738b
...
...
@@ -58,7 +58,7 @@ namespace Titanium.Web.Proxy
// if user requested call back then do it
if
(!
response
.
Locked
)
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
}
// it may changed in the user event
...
...
@@ -132,7 +132,7 @@ namespace Titanium.Web.Proxy
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private
async
Task
invoke
BeforeResponse
(
SessionEventArgs
args
)
private
async
Task
on
BeforeResponse
(
SessionEventArgs
args
)
{
if
(
BeforeResponse
!=
null
)
{
...
...
@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private
async
Task
invoke
AfterResponse
(
SessionEventArgs
args
)
private
async
Task
on
AfterResponse
(
SessionEventArgs
args
)
{
if
(
AfterResponse
!=
null
)
{
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.NetCore.csproj
View file @
d0a7738b
...
...
@@ -19,19 +19,19 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.
5
.0</Version>
<Version>4.
6
.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.
5.1
</Version>
<Version>4.
6.0
</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.
5
.0</Version>
<Version>4.
6
.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.
5.1
</Version>
<Version>4.
6.0
</Version>
</PackageReference>
</ItemGroup>
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
View file @
d0a7738b
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net
standard2.1;net
coreapp2.1</TargetFrameworks>
<RootNamespace>Titanium.Web.Proxy</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>True</SignAssembly>
...
...
@@ -19,19 +19,28 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.
5
.0</Version>
<Version>4.
6
.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.5.1</Version>
<Version>4.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.
5
.0</Version>
<Version>4.
6
.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.
5.1
</Version>
<Version>4.
6.0
</Version>
</PackageReference>
</ItemGroup>
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.nuspec
View file @
d0a7738b
...
...
@@ -17,21 +17,29 @@
<group
targetFramework=
"netstandard2.0"
>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.5"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.3"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.
5
.0"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.
6
.0"
/>
<dependency
id=
"System.Buffers"
version=
"4.5.0"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.5.1"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.6.0"
/>
</group>
<group
targetFramework=
"netstandard2.1"
>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.5"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.3"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.6.0"
/>
<dependency
id=
"System.Buffers"
version=
"4.5.0"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.6.0"
/>
</group>
<group
targetFramework=
"netcoreapp2.1"
>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.5"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.3"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.
5
.0"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.
6
.0"
/>
<dependency
id=
"System.Buffers"
version=
"4.5.0"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.
5.1
"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.
6.0
"
/>
</group>
</dependencies>
</metadata>
<files>
<file
src=
"bin\$configuration$\netstandard2.0\Titanium.Web.Proxy.dll"
target=
"lib\netstandard2.0"
/>
<file
src=
"bin\$configuration$\netstandard2.1\Titanium.Web.Proxy.dll"
target=
"lib\netstandard2.1"
/>
<file
src=
"bin\$configuration$\netcoreapp2.1\Titanium.Web.Proxy.dll"
target=
"lib\netcoreapp2.1"
/>
</files>
</package>
src/Titanium.Web.Proxy/WebSocketHandler.cs
View file @
d0a7738b
...
...
@@ -60,7 +60,7 @@ namespace Titanium.Web.Proxy
// If user requested call back then do it
if
(!
args
.
HttpClient
.
Response
.
Locked
)
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
}
await
TcpHelper
.
SendRaw
(
clientStream
,
serverConnection
.
Stream
,
BufferPool
,
...
...
tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj
View file @
d0a7738b
...
...
@@ -16,10 +16,10 @@
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="
2.2
.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.
2
.0" />
<PackageReference Include="MSTest.TestAdapter" Version="
1.4
.0" />
<PackageReference Include="MSTest.TestFramework" Version="
1.4
.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="
3.0
.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.
3
.0" />
<PackageReference Include="MSTest.TestAdapter" Version="
2.0
.0" />
<PackageReference Include="MSTest.TestFramework" Version="
2.0
.0" />
</ItemGroup>
<ItemGroup>
...
...
tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj
View file @
d0a7738b
...
...
@@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.
2
.0" />
<PackageReference Include="MSTest.TestAdapter" Version="
1.4
.0" />
<PackageReference Include="MSTest.TestFramework" Version="
1.4
.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.
3
.0" />
<PackageReference Include="MSTest.TestAdapter" Version="
2.0
.0" />
<PackageReference Include="MSTest.TestFramework" Version="
2.0
.0" />
</ItemGroup>
<ItemGroup>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment