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
8518da5e
Commit
8518da5e
authored
May 19, 2017
by
justcoding121
Committed by
justcoding121
May 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#242 Fix external proxy
parent
16c91fbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
ExternalProxy.cs
Titanium.Web.Proxy/Models/ExternalProxy.cs
+1
-1
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+30
-3
No files found.
Titanium.Web.Proxy/Models/ExternalProxy.cs
View file @
8518da5e
...
@@ -21,7 +21,7 @@ namespace Titanium.Web.Proxy.Models
...
@@ -21,7 +21,7 @@ namespace Titanium.Web.Proxy.Models
/// <summary>
/// <summary>
/// Bypass this proxy for connections to localhost?
/// Bypass this proxy for connections to localhost?
/// </summary>
/// </summary>
public
bool
Bypass
For
Localhost
{
get
;
set
;
}
public
bool
BypassLocalhost
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Username.
/// Username.
...
...
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
8518da5e
...
@@ -39,10 +39,37 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -39,10 +39,37 @@ namespace Titanium.Web.Proxy.Network.Tcp
TcpClient
client
;
TcpClient
client
;
CustomBufferedStream
stream
;
CustomBufferedStream
stream
;
bool
isLocalhost
=
(
externalHttpsProxy
!=
null
||
externalHttpProxy
!=
null
)
&&
NetworkHelper
.
IsLocalIpAddress
(
remoteHostName
);
bool
useHttpProxy
=
false
;
//check if external proxy is set for HTTP
if
(!
isHttps
&&
externalHttpProxy
!=
null
&&
externalHttpProxy
.
HostName
!=
remoteHostName
)
{
useHttpProxy
=
true
;
//check if we need to ByPass
if
(
externalHttpProxy
.
BypassLocalhost
&&
NetworkHelper
.
IsLocalIpAddress
(
remoteHostName
))
{
useHttpProxy
=
false
;
}
}
bool
useHttpsProxy
=
externalHttpsProxy
!=
null
&&
externalHttpsProxy
.
HostName
!=
remoteHostName
&&
externalHttpsProxy
.
BypassForLocalhost
&&
!
isLocalhost
;
bool
useHttpsProxy
=
false
;
bool
useHttpProxy
=
externalHttpProxy
!=
null
&&
externalHttpProxy
.
HostName
!=
remoteHostName
&&
externalHttpProxy
.
BypassForLocalhost
&&
!
isLocalhost
;
//check if external proxy is set for HTTPS
if
(
isHttps
&&
externalHttpsProxy
!=
null
&&
externalHttpsProxy
.
HostName
!=
remoteHostName
)
{
useHttpsProxy
=
true
;
//check if we need to ByPass
if
(
externalHttpsProxy
.
BypassLocalhost
&&
NetworkHelper
.
IsLocalIpAddress
(
remoteHostName
))
{
useHttpsProxy
=
false
;
}
}
if
(
isHttps
)
if
(
isHttps
)
{
{
...
...
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