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
494b0e6f
Commit
494b0e6f
authored
Jul 18, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix UpstreamEndpoint override
parent
15f2969b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
13 deletions
+14
-13
SessionEventArgs.cs
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
+2
-2
TunnelConnectEventArgs.cs
Titanium.Web.Proxy/EventArguments/TunnelConnectEventArgs.cs
+2
-2
HttpWebClient.cs
Titanium.Web.Proxy/Http/HttpWebClient.cs
+1
-2
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+2
-1
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+7
-6
No files found.
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
View file @
494b0e6f
...
...
@@ -99,14 +99,14 @@ namespace Titanium.Web.Proxy.EventArguments
/// Constructor to initialize the proxy
/// </summary>
internal
SessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
,
IPEndPoint
upStreamEndPoint
,
ProxyEndPoint
endPoint
,
Func
<
SessionEventArgs
,
Task
>
httpResponseHandler
)
{
this
.
bufferSize
=
bufferSize
;
this
.
httpResponseHandler
=
httpResponseHandler
;
ProxyClient
=
new
ProxyClient
();
WebSession
=
new
HttpWebClient
(
bufferSize
,
upStreamEndPoint
);
WebSession
=
new
HttpWebClient
(
bufferSize
);
WebSession
.
ProcessId
=
new
Lazy
<
int
>(()
=>
{
...
...
Titanium.Web.Proxy/EventArguments/TunnelConnectEventArgs.cs
View file @
494b0e6f
...
...
@@ -7,8 +7,8 @@ namespace Titanium.Web.Proxy.EventArguments
{
public
bool
IsHttpsConnect
{
get
;
set
;
}
public
TunnelConnectSessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
,
IPEndPoint
upStreamEndPoint
)
:
base
(
bufferSize
,
endPoint
,
upStreamEndPoint
,
null
)
public
TunnelConnectSessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
)
:
base
(
bufferSize
,
endPoint
,
null
)
{
}
...
...
Titanium.Web.Proxy/Http/HttpWebClient.cs
View file @
494b0e6f
...
...
@@ -56,10 +56,9 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
public
bool
IsHttps
=>
Request
.
IsHttps
;
internal
HttpWebClient
(
int
bufferSize
,
IPEndPoint
upStreamEndPoint
)
internal
HttpWebClient
(
int
bufferSize
)
{
this
.
bufferSize
=
bufferSize
;
UpStreamEndPoint
=
upStreamEndPoint
;
RequestId
=
Guid
.
NewGuid
();
Request
=
new
Request
();
...
...
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
494b0e6f
...
...
@@ -55,7 +55,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
try
{
#if NET45
client
=
new
TcpClient
(
upStreamEndPoint
??
server
.
UpStreamEndPoint
);
client
=
new
TcpClient
(
upStreamEndPoint
);
#else
client
=
new
TcpClient
();
client
.
Client
.
Bind
(
server
.
UpStreamEndPoint
);
...
...
@@ -131,6 +131,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
{
UpStreamHttpProxy
=
externalHttpProxy
,
UpStreamHttpsProxy
=
externalHttpsProxy
,
UpStreamEndPoint
=
upStreamEndPoint
,
HostName
=
remoteHostName
,
Port
=
remotePort
,
IsHttps
=
isHttps
,
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
494b0e6f
...
...
@@ -86,7 +86,7 @@ namespace Titanium.Web.Proxy
await
HeaderParser
.
ReadHeaders
(
clientStreamReader
,
connectRequest
.
RequestHeaders
);
var
connectArgs
=
new
TunnelConnectSessionEventArgs
(
BufferSize
,
endPoint
,
UpStreamEndPoint
);
var
connectArgs
=
new
TunnelConnectSessionEventArgs
(
BufferSize
,
endPoint
);
connectArgs
.
WebSession
.
Request
=
connectRequest
;
connectArgs
.
ProxyClient
.
TcpClient
=
tcpClient
;
connectArgs
.
ProxyClient
.
ClientStream
=
clientStream
;
...
...
@@ -293,7 +293,7 @@ namespace Titanium.Web.Proxy
break
;
}
var
args
=
new
SessionEventArgs
(
BufferSize
,
endPoint
,
UpStreamEndPoint
,
HandleHttpSessionResponse
)
var
args
=
new
SessionEventArgs
(
BufferSize
,
endPoint
,
HandleHttpSessionResponse
)
{
ProxyClient
=
{
TcpClient
=
client
},
WebSession
=
{
ConnectRequest
=
connectRequest
}
...
...
@@ -355,9 +355,10 @@ namespace Titanium.Web.Proxy
}
//create a new connection if hostname/upstream end point changes
if
(
connection
!=
null
if
(
connection
!=
null
&&
(!
connection
.
HostName
.
Equals
(
args
.
WebSession
.
Request
.
RequestUri
.
Host
,
StringComparison
.
OrdinalIgnoreCase
)
||
args
.
WebSession
.
UpStreamEndPoint
!=
connection
.
UpStreamEndPoint
))
||
(
args
.
WebSession
.
UpStreamEndPoint
!=
null
&&
!
args
.
WebSession
.
UpStreamEndPoint
.
Equals
(
connection
.
UpStreamEndPoint
))))
{
connection
.
Dispose
();
UpdateServerConnectionCount
(
false
);
...
...
@@ -573,7 +574,7 @@ namespace Titanium.Web.Proxy
/// <param name="args"></param>
/// <param name="isConnect"></param>
/// <returns></returns>
private
async
Task
<
TcpConnection
>
GetServerConnection
(
SessionEventArgs
args
,
bool
isConnect
)
private
async
Task
<
TcpConnection
>
GetServerConnection
(
SessionEventArgs
args
,
bool
isConnect
)
{
ExternalProxy
customUpStreamHttpProxy
=
null
;
ExternalProxy
customUpStreamHttpsProxy
=
null
;
...
...
@@ -601,7 +602,7 @@ namespace Titanium.Web.Proxy
args
.
WebSession
.
Request
.
RequestUri
.
Port
,
args
.
WebSession
.
Request
.
HttpVersion
,
args
.
IsHttps
,
isConnect
,
args
.
WebSession
.
UpStreamEndPoint
,
args
.
WebSession
.
UpStreamEndPoint
??
UpStreamEndPoint
,
customUpStreamHttpProxy
??
UpStreamHttpProxy
,
customUpStreamHttpsProxy
??
UpStreamHttpsProxy
);
}
...
...
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