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
1e8cf7e2
Commit
1e8cf7e2
authored
Jun 28, 2017
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use proxy renamed to use upstream proxy
parent
d49448ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
TcpConnection.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnection.cs
+2
-2
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+5
-5
No files found.
Titanium.Web.Proxy/Network/Tcp/TcpConnection.cs
View file @
1e8cf7e2
...
@@ -16,7 +16,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -16,7 +16,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
internal
ExternalProxy
UpStreamHttpsProxy
{
get
;
set
;
}
internal
ExternalProxy
UpStreamHttpsProxy
{
get
;
set
;
}
internal
ExternalProxy
UpStreamProxy
=>
UseProxy
?
IsHttps
?
UpStreamHttpsProxy
:
UpStreamHttpProxy
:
null
;
internal
ExternalProxy
UpStreamProxy
=>
Use
Upstream
Proxy
?
IsHttps
?
UpStreamHttpsProxy
:
UpStreamHttpProxy
:
null
;
internal
string
HostName
{
get
;
set
;
}
internal
string
HostName
{
get
;
set
;
}
...
@@ -24,7 +24,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -24,7 +24,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
internal
bool
IsHttps
{
get
;
set
;
}
internal
bool
IsHttps
{
get
;
set
;
}
internal
bool
UseProxy
{
get
;
set
;
}
internal
bool
Use
Upstream
Proxy
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Http version
/// Http version
...
...
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
1e8cf7e2
...
@@ -32,18 +32,18 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -32,18 +32,18 @@ namespace Titanium.Web.Proxy.Network.Tcp
internal
async
Task
<
TcpConnection
>
CreateClient
(
ProxyServer
server
,
string
remoteHostName
,
int
remotePort
,
Version
httpVersion
,
bool
isHttps
,
internal
async
Task
<
TcpConnection
>
CreateClient
(
ProxyServer
server
,
string
remoteHostName
,
int
remotePort
,
Version
httpVersion
,
bool
isHttps
,
ExternalProxy
externalHttpProxy
,
ExternalProxy
externalHttpsProxy
)
ExternalProxy
externalHttpProxy
,
ExternalProxy
externalHttpsProxy
)
{
{
bool
useProxy
=
false
;
bool
use
Upstream
Proxy
=
false
;
var
externalProxy
=
isHttps
?
externalHttpsProxy
:
externalHttpProxy
;
var
externalProxy
=
isHttps
?
externalHttpsProxy
:
externalHttpProxy
;
//check if external proxy is set for HTTP/HTTPS
//check if external proxy is set for HTTP/HTTPS
if
(
externalProxy
!=
null
&&
!(
externalProxy
.
HostName
==
remoteHostName
&&
externalProxy
.
Port
==
remotePort
))
if
(
externalProxy
!=
null
&&
!(
externalProxy
.
HostName
==
remoteHostName
&&
externalProxy
.
Port
==
remotePort
))
{
{
useProxy
=
true
;
use
Upstream
Proxy
=
true
;
//check if we need to ByPass
//check if we need to ByPass
if
(
externalProxy
.
BypassLocalhost
&&
NetworkHelper
.
IsLocalIpAddress
(
remoteHostName
))
if
(
externalProxy
.
BypassLocalhost
&&
NetworkHelper
.
IsLocalIpAddress
(
remoteHostName
))
{
{
useProxy
=
false
;
use
Upstream
Proxy
=
false
;
}
}
}
}
...
@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
try
try
{
{
//If this proxy uses another external proxy then create a tunnel request for HTTP/HTTPS connections
//If this proxy uses another external proxy then create a tunnel request for HTTP/HTTPS connections
if
(
useProxy
)
if
(
use
Upstream
Proxy
)
{
{
#if NET45
#if NET45
client
=
new
TcpClient
(
server
.
UpStreamEndPoint
);
client
=
new
TcpClient
(
server
.
UpStreamEndPoint
);
...
@@ -136,7 +136,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -136,7 +136,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
HostName
=
remoteHostName
,
HostName
=
remoteHostName
,
Port
=
remotePort
,
Port
=
remotePort
,
IsHttps
=
isHttps
,
IsHttps
=
isHttps
,
Use
Proxy
=
use
Proxy
,
Use
UpstreamProxy
=
useUpstream
Proxy
,
TcpClient
=
client
,
TcpClient
=
client
,
StreamReader
=
new
CustomBinaryReader
(
stream
,
server
.
BufferSize
),
StreamReader
=
new
CustomBinaryReader
(
stream
,
server
.
BufferSize
),
Stream
=
stream
,
Stream
=
stream
,
...
...
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