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
0bfe7a74
Commit
0bfe7a74
authored
Sep 28, 2019
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netstandard 2.1 added
parent
bac300f3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
68 deletions
+52
-68
Titanium.Web.Proxy.Examples.Wpf.csproj
...Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
+3
-30
ExplicitClientHandler.cs
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
+4
-7
SslExtensions.cs
src/Titanium.Web.Proxy/Extensions/SslExtensions.cs
+2
-2
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
RequestHandler.cs
src/Titanium.Web.Proxy/RequestHandler.cs
+7
-7
ResponseHandler.cs
src/Titanium.Web.Proxy/ResponseHandler.cs
+3
-3
Titanium.Web.Proxy.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
+10
-1
WebSocketHandler.cs
src/Titanium.Web.Proxy/WebSocketHandler.cs
+1
-1
No files found.
examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
View file @
0bfe7a74
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
<UseWPF>true</UseWPF>
<UseWPF>true</UseWPF>
</PropertyGroup>
</PropertyGroup>
<
!--<ItemGroup
>
<
ItemGroup Condition="'$(TargetFramework)' == 'net461'"
>
<Reference Include="PresentationCore" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsBase" />
</ItemGroup>
-->
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
<Compile Remove="Properties\AssemblyInfo.cs" />
...
@@ -20,23 +20,6 @@
...
@@ -20,23 +20,6 @@
<ProjectReference Include="..\..\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
<ProjectReference Include="..\..\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
</ItemGroup>
</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>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<AutoGen>True</AutoGen>
...
@@ -52,16 +35,6 @@
...
@@ -52,16 +35,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</EmbeddedResource>
<None Update="App.xaml">
</ItemGroup>
<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>-->
</Project>
</Project>
\ No newline at end of file
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
0bfe7a74
...
@@ -288,8 +288,7 @@ namespace Titanium.Web.Proxy
...
@@ -288,8 +288,7 @@ namespace Titanium.Web.Proxy
if
(!
clientStream
.
IsClosed
&&
!
connection
.
Stream
.
IsClosed
)
if
(!
clientStream
.
IsClosed
&&
!
connection
.
Stream
.
IsClosed
)
{
{
await
TcpHelper
.
SendRaw
(
clientStream
,
connection
.
Stream
,
BufferPool
,
await
TcpHelper
.
SendRaw
(
clientStream
,
connection
.
Stream
,
BufferPool
,
null
,
null
,
null
,
null
,
connectArgs
.
CancellationTokenSource
,
ExceptionFunc
);
connectArgs
.
CancellationTokenSource
,
ExceptionFunc
);
}
}
}
}
finally
finally
...
@@ -338,17 +337,15 @@ namespace Titanium.Web.Proxy
...
@@ -338,17 +337,15 @@ namespace Titanium.Web.Proxy
await
connection
.
StreamWriter
.
WriteLineAsync
(
"SM"
,
cancellationToken
);
await
connection
.
StreamWriter
.
WriteLineAsync
(
"SM"
,
cancellationToken
);
await
connection
.
StreamWriter
.
WriteLineAsync
(
cancellationToken
);
await
connection
.
StreamWriter
.
WriteLineAsync
(
cancellationToken
);
#if NETCOREAPP2_1
#if NETCOREAPP2_1
await
Http2Helper
.
SendHttp2
(
clientStream
,
connection
.
Stream
,
BufferPool
.
BufferSize
,
await
Http2Helper
.
SendHttp2
(
clientStream
,
connection
.
Stream
,
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDecryptedDataSent
(
buffer
,
offset
,
count
);
},
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDecryptedDataReceived
(
buffer
,
offset
,
count
);
},
()
=>
new
SessionEventArgs
(
this
,
endPoint
,
cancellationTokenSource
)
()
=>
new
SessionEventArgs
(
this
,
endPoint
,
cancellationTokenSource
)
{
{
ProxyClient
=
{
Connection
=
clientConnection
},
ProxyClient
=
{
Connection
=
clientConnection
},
HttpClient
=
{
ConnectRequest
=
connectArgs
?.
HttpClient
.
ConnectRequest
},
HttpClient
=
{
ConnectRequest
=
connectArgs
?.
HttpClient
.
ConnectRequest
},
UserData
=
connectArgs
?.
UserData
UserData
=
connectArgs
?.
UserData
},
},
async
args
=>
{
await
invoke
BeforeRequest
(
args
);
},
async
args
=>
{
await
on
BeforeRequest
(
args
);
},
async
args
=>
{
await
invoke
BeforeResponse
(
args
);
},
async
args
=>
{
await
on
BeforeResponse
(
args
);
},
connectArgs
.
CancellationTokenSource
,
clientConnection
.
Id
,
ExceptionFunc
);
connectArgs
.
CancellationTokenSource
,
clientConnection
.
Id
,
ExceptionFunc
);
#endif
#endif
}
}
...
...
src/Titanium.Web.Proxy/Extensions/SslExtensions.cs
View file @
0bfe7a74
...
@@ -28,7 +28,7 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -28,7 +28,7 @@ namespace Titanium.Web.Proxy.Extensions
return
null
;
return
null
;
}
}
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
internal
static
List
<
SslApplicationProtocol
>
GetAlpn
(
this
ClientHelloInfo
clientHelloInfo
)
internal
static
List
<
SslApplicationProtocol
>
GetAlpn
(
this
ClientHelloInfo
clientHelloInfo
)
{
{
if
(
clientHelloInfo
.
Extensions
!=
null
&&
clientHelloInfo
.
Extensions
.
TryGetValue
(
"ALPN"
,
out
var
alpnExtension
))
if
(
clientHelloInfo
.
Extensions
!=
null
&&
clientHelloInfo
.
Extensions
.
TryGetValue
(
"ALPN"
,
out
var
alpnExtension
))
...
@@ -78,7 +78,7 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -78,7 +78,7 @@ namespace Titanium.Web.Proxy.Extensions
#endif
#endif
}
}
#if !NETCOREAPP2_1
#if !NETCOREAPP2_1
&& !NETSTANDARD2_1
internal
enum
SslApplicationProtocol
internal
enum
SslApplicationProtocol
{
{
Http11
,
Http11
,
...
...
src/Titanium.Web.Proxy/Http2/Http2Helper.cs
View file @
0bfe7a74
#
if
NETCOREAPP2_1
#
if
NETCOREAPP2_1
||
NETSTANDARD2_1
using
System
;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -24,8 +24,7 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -24,8 +24,7 @@ namespace Titanium.Web.Proxy.Http2
/// Task-based Asynchronous Pattern
/// Task-based Asynchronous Pattern
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
internal
static
async
Task
SendHttp2
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
internal
static
async
Task
SendHttp2
(
Stream
clientStream
,
Stream
serverStream
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
Func
<
SessionEventArgs
>
sessionFactory
,
Func
<
SessionEventArgs
>
sessionFactory
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequest
,
Func
<
SessionEventArgs
,
Task
>
onBeforeResponse
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequest
,
Func
<
SessionEventArgs
,
Task
>
onBeforeResponse
,
CancellationTokenSource
cancellationTokenSource
,
Guid
connectionId
,
CancellationTokenSource
cancellationTokenSource
,
Guid
connectionId
,
...
@@ -38,13 +37,13 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -38,13 +37,13 @@ namespace Titanium.Web.Proxy.Http2
// Now async relay all server=>client & client=>server data
// Now async relay all server=>client & client=>server data
var
sendRelay
=
var
sendRelay
=
copyHttp2FrameAsync
(
clientStream
,
serverStream
,
onDataSend
,
clientSettings
,
serverSettings
,
copyHttp2FrameAsync
(
clientStream
,
serverStream
,
clientSettings
,
serverSettings
,
sessionFactory
,
sessions
,
onBeforeRequest
,
sessionFactory
,
sessions
,
onBeforeRequest
,
bufferSize
,
connectionId
,
true
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
connectionId
,
true
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
var
receiveRelay
=
var
receiveRelay
=
copyHttp2FrameAsync
(
serverStream
,
clientStream
,
onDataReceive
,
serverSettings
,
clientSettings
,
copyHttp2FrameAsync
(
serverStream
,
clientStream
,
serverSettings
,
clientSettings
,
sessionFactory
,
sessions
,
onBeforeResponse
,
sessionFactory
,
sessions
,
onBeforeResponse
,
bufferSize
,
connectionId
,
false
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
connectionId
,
false
,
cancellationTokenSource
.
Token
,
exceptionFunc
);
await
Task
.
WhenAny
(
sendRelay
,
receiveRelay
);
await
Task
.
WhenAny
(
sendRelay
,
receiveRelay
);
cancellationTokenSource
.
Cancel
();
cancellationTokenSource
.
Cancel
();
...
@@ -52,11 +51,11 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -52,11 +51,11 @@ namespace Titanium.Web.Proxy.Http2
await
Task
.
WhenAll
(
sendRelay
,
receiveRelay
);
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
,
Http2Settings
localSettings
,
Http2Settings
remoteSettings
,
Func
<
SessionEventArgs
>
sessionFactory
,
ConcurrentDictionary
<
int
,
SessionEventArgs
>
sessions
,
Func
<
SessionEventArgs
>
sessionFactory
,
ConcurrentDictionary
<
int
,
SessionEventArgs
>
sessions
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequestResponse
,
Func
<
SessionEventArgs
,
Task
>
onBeforeRequestResponse
,
int
bufferSize
,
Guid
connectionId
,
bool
isClient
,
CancellationToken
cancellationToken
,
Guid
connectionId
,
bool
isClient
,
CancellationToken
cancellationToken
,
ExceptionHandler
exceptionFunc
)
ExceptionHandler
exceptionFunc
)
{
{
int
headerTableSize
=
0
;
int
headerTableSize
=
0
;
...
@@ -69,7 +68,6 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -69,7 +68,6 @@ namespace Titanium.Web.Proxy.Http2
{
{
var
frameHeaderBuffer
=
frameHeader
.
Buffer
;
var
frameHeaderBuffer
=
frameHeader
.
Buffer
;
int
read
=
await
forceRead
(
input
,
frameHeaderBuffer
,
0
,
9
,
cancellationToken
);
int
read
=
await
forceRead
(
input
,
frameHeaderBuffer
,
0
,
9
,
cancellationToken
);
onCopy
(
frameHeaderBuffer
,
0
,
read
);
if
(
read
!=
9
)
if
(
read
!=
9
)
{
{
return
;
return
;
...
@@ -92,7 +90,6 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -92,7 +90,6 @@ namespace Titanium.Web.Proxy.Http2
}
}
read
=
await
forceRead
(
input
,
buffer
,
0
,
length
,
cancellationToken
);
read
=
await
forceRead
(
input
,
buffer
,
0
,
length
,
cancellationToken
);
onCopy
(
buffer
,
0
,
read
);
if
(
read
!=
length
)
if
(
read
!=
length
)
{
{
return
;
return
;
...
@@ -127,6 +124,11 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -127,6 +124,11 @@ namespace Titanium.Web.Proxy.Http2
//System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type);
//System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type);
if
(
type
==
Http2FrameType
.
Data
&&
args
!=
null
)
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
;
rr
=
isClient
?
(
RequestResponseBase
)
args
.
HttpClient
.
Request
:
args
.
HttpClient
.
Response
;
bool
padded
=
(
flags
&
Http2FrameFlag
.
Padded
)
!=
0
;
bool
padded
=
(
flags
&
Http2FrameFlag
.
Padded
)
!=
0
;
...
@@ -182,8 +184,10 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -182,8 +184,10 @@ namespace Titanium.Web.Proxy.Http2
{
{
args
=
sessionFactory
();
args
=
sessionFactory
();
args
.
IsPromise
=
true
;
args
.
IsPromise
=
true
;
sessions
.
TryAdd
(
streamId
,
args
);
if
(!
sessions
.
TryAdd
(
streamId
,
args
))
sessions
.
TryAdd
(
promisedStreamId
,
args
);
;
if
(!
sessions
.
TryAdd
(
promisedStreamId
,
args
))
;
}
}
System
.
Diagnostics
.
Debug
.
WriteLine
(
"PROMISE STREAM: "
+
streamId
+
", "
+
promisedStreamId
+
System
.
Diagnostics
.
Debug
.
WriteLine
(
"PROMISE STREAM: "
+
streamId
+
", "
+
promisedStreamId
+
...
@@ -201,7 +205,8 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -201,7 +205,8 @@ namespace Titanium.Web.Proxy.Http2
if
(!
sessions
.
TryGetValue
(
streamId
,
out
args
))
if
(!
sessions
.
TryGetValue
(
streamId
,
out
args
))
{
{
args
=
sessionFactory
();
args
=
sessionFactory
();
sessions
.
TryAdd
(
streamId
,
args
);
if
(!
sessions
.
TryAdd
(
streamId
,
args
))
;
}
}
rr
=
isClient
?
(
RequestResponseBase
)
args
.
HttpClient
.
Request
:
args
.
HttpClient
.
Response
;
rr
=
isClient
?
(
RequestResponseBase
)
args
.
HttpClient
.
Request
:
args
.
HttpClient
.
Response
;
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs
View file @
0bfe7a74
using
System
;
using
System
;
using
System.IO
;
using
System.IO
;
using
System.Net
;
using
System.Net
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
using
System.Net.Security
;
#endif
#endif
using
System.Net.Sockets
;
using
System.Net.Sockets
;
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
0bfe7a74
...
@@ -391,7 +391,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -391,7 +391,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
CertificateRevocationCheckMode
=
proxyServer
.
CheckCertificateRevocation
CertificateRevocationCheckMode
=
proxyServer
.
CheckCertificateRevocation
};
};
await
sslStream
.
AuthenticateAsClientAsync
(
options
,
cancellationToken
);
await
sslStream
.
AuthenticateAsClientAsync
(
options
,
cancellationToken
);
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
negotiatedApplicationProtocol
=
sslStream
.
NegotiatedApplicationProtocol
;
negotiatedApplicationProtocol
=
sslStream
.
NegotiatedApplicationProtocol
;
#endif
#endif
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs
View file @
0bfe7a74
using
System
;
using
System
;
using
System.Net
;
using
System.Net
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
using
System.Net.Security
;
#endif
#endif
using
System.Net.Sockets
;
using
System.Net.Sockets
;
...
...
src/Titanium.Web.Proxy/RequestHandler.cs
View file @
0bfe7a74
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Net
;
using
System.Net
;
using
System.Net.Sockets
;
using
System.Net.Sockets
;
#if NETCOREAPP2_1
#if NETCOREAPP2_1
|| NETSTANDARD2_1
using
System.Net.Security
;
using
System.Net.Security
;
#endif
#endif
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
...
@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy
...
@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy
// proxy authorization check
// proxy authorization check
if
(
httpsConnectHostname
==
null
&&
await
checkAuthorization
(
args
)
==
false
)
if
(
httpsConnectHostname
==
null
&&
await
checkAuthorization
(
args
)
==
false
)
{
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
// send the response
// send the response
await
clientStreamWriter
.
WriteResponseAsync
(
args
.
HttpClient
.
Response
,
await
clientStreamWriter
.
WriteResponseAsync
(
args
.
HttpClient
.
Response
,
...
@@ -166,10 +166,8 @@ namespace Titanium.Web.Proxy
...
@@ -166,10 +166,8 @@ namespace Titanium.Web.Proxy
// we need this to syphon out data from connection if API user changes them.
// we need this to syphon out data from connection if API user changes them.
request
.
SetOriginalHeaders
();
request
.
SetOriginalHeaders
();
args
.
TimeLine
[
"Request Received"
]
=
DateTime
.
Now
;
// If user requested interception do it
// If user requested interception do it
await
invoke
BeforeRequest
(
args
);
await
on
BeforeRequest
(
args
);
var
response
=
args
.
HttpClient
.
Response
;
var
response
=
args
.
HttpClient
.
Response
;
...
@@ -286,7 +284,7 @@ namespace Titanium.Web.Proxy
...
@@ -286,7 +284,7 @@ namespace Titanium.Web.Proxy
}
}
finally
finally
{
{
await
invoke
AfterResponse
(
args
);
await
on
AfterResponse
(
args
);
args
.
Dispose
();
args
.
Dispose
();
}
}
}
}
...
@@ -410,8 +408,10 @@ namespace Titanium.Web.Proxy
...
@@ -410,8 +408,10 @@ namespace Titanium.Web.Proxy
/// </summary>
/// </summary>
/// <param name="args">The session event arguments.</param>
/// <param name="args">The session event arguments.</param>
/// <returns></returns>
/// <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
)
if
(
BeforeRequest
!=
null
)
{
{
await
BeforeRequest
.
InvokeAsync
(
this
,
args
,
ExceptionFunc
);
await
BeforeRequest
.
InvokeAsync
(
this
,
args
,
ExceptionFunc
);
...
...
src/Titanium.Web.Proxy/ResponseHandler.cs
View file @
0bfe7a74
...
@@ -58,7 +58,7 @@ namespace Titanium.Web.Proxy
...
@@ -58,7 +58,7 @@ namespace Titanium.Web.Proxy
// if user requested call back then do it
// if user requested call back then do it
if
(!
response
.
Locked
)
if
(!
response
.
Locked
)
{
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
}
}
// it may changed in the user event
// it may changed in the user event
...
@@ -132,7 +132,7 @@ namespace Titanium.Web.Proxy
...
@@ -132,7 +132,7 @@ namespace Titanium.Web.Proxy
/// </summary>
/// </summary>
/// <param name="args"></param>
/// <param name="args"></param>
/// <returns></returns>
/// <returns></returns>
private
async
Task
invoke
BeforeResponse
(
SessionEventArgs
args
)
private
async
Task
on
BeforeResponse
(
SessionEventArgs
args
)
{
{
if
(
BeforeResponse
!=
null
)
if
(
BeforeResponse
!=
null
)
{
{
...
@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy
...
@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy
/// </summary>
/// </summary>
/// <param name="args"></param>
/// <param name="args"></param>
/// <returns></returns>
/// <returns></returns>
private
async
Task
invoke
AfterResponse
(
SessionEventArgs
args
)
private
async
Task
on
AfterResponse
(
SessionEventArgs
args
)
{
{
if
(
AfterResponse
!=
null
)
if
(
AfterResponse
!=
null
)
{
{
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
View file @
0bfe7a74
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net
standard2.1;net
coreapp2.1</TargetFrameworks>
<RootNamespace>Titanium.Web.Proxy</RootNamespace>
<RootNamespace>Titanium.Web.Proxy</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>True</SignAssembly>
<SignAssembly>True</SignAssembly>
...
@@ -26,6 +26,15 @@
...
@@ -26,6 +26,15 @@
</PackageReference>
</PackageReference>
</ItemGroup>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.5.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.Win32.Registry">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.5.0</Version>
<Version>4.5.0</Version>
...
...
src/Titanium.Web.Proxy/WebSocketHandler.cs
View file @
0bfe7a74
...
@@ -60,7 +60,7 @@ namespace Titanium.Web.Proxy
...
@@ -60,7 +60,7 @@ namespace Titanium.Web.Proxy
// If user requested call back then do it
// If user requested call back then do it
if
(!
args
.
HttpClient
.
Response
.
Locked
)
if
(!
args
.
HttpClient
.
Response
.
Locked
)
{
{
await
invoke
BeforeResponse
(
args
);
await
on
BeforeResponse
(
args
);
}
}
await
TcpHelper
.
SendRaw
(
clientStream
,
serverConnection
.
Stream
,
BufferPool
,
await
TcpHelper
.
SendRaw
(
clientStream
,
serverConnection
.
Stream
,
BufferPool
,
...
...
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