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
48c041e6
Commit
48c041e6
authored
Mar 31, 2019
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#565 Verify hostname before prefetching connection
parent
10c923e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
ExplicitClientHandler.cs
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
+12
-6
No files found.
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
48c041e6
...
@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy
...
@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy
{
{
string
connectHostname
=
null
;
string
connectHostname
=
null
;
TunnelConnectSessionEventArgs
connectArgs
=
null
;
TunnelConnectSessionEventArgs
connectArgs
=
null
;
// Client wants to create a secure tcp tunnel (probably its a HTTPS or Websocket request)
// Client wants to create a secure tcp tunnel (probably its a HTTPS or Websocket request)
if
(
await
HttpHelper
.
IsConnectMethod
(
clientStream
)
==
1
)
if
(
await
HttpHelper
.
IsConnectMethod
(
clientStream
)
==
1
)
...
@@ -154,11 +154,17 @@ namespace Titanium.Web.Proxy
...
@@ -154,11 +154,17 @@ namespace Titanium.Web.Proxy
if
(
EnableTcpServerConnectionPrefetch
)
if
(
EnableTcpServerConnectionPrefetch
)
{
{
//don't pass cancellation token here
//make sure the host can be resolved before creating the prefetch task
//it could cause floating server connections when client exits
var
ipAddresses
=
await
Dns
.
GetHostAddressesAsync
(
connectArgs
.
HttpClient
.
Request
.
RequestUri
.
Host
);
prefetchConnectionTask
=
tcpConnectionFactory
.
GetServerConnection
(
this
,
connectArgs
,
isConnect
:
true
,
applicationProtocols
:
null
,
noCache
:
false
,
if
(
ipAddresses
!=
null
&&
ipAddresses
.
Length
>
0
)
cancellationToken
:
CancellationToken
.
None
);
{
//don't pass cancellation token here
//it could cause floating server connections when client exits
prefetchConnectionTask
=
tcpConnectionFactory
.
GetServerConnection
(
this
,
connectArgs
,
isConnect
:
true
,
applicationProtocols
:
null
,
noCache
:
false
,
cancellationToken
:
CancellationToken
.
None
);
}
}
}
X509Certificate2
certificate
=
null
;
X509Certificate2
certificate
=
null
;
...
...
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