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
be556d21
Commit
be556d21
authored
Jun 16, 2017
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove proxy settings when it is probably remained there because a previous non graceful quit
parent
72d493a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+1
-1
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+17
-0
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
be556d21
...
@@ -31,7 +31,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -31,7 +31,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
proxyServer
.
ExceptionFunc
=
exception
=>
Console
.
WriteLine
(
exception
.
Message
);
proxyServer
.
ExceptionFunc
=
exception
=>
Console
.
WriteLine
(
exception
.
Message
);
proxyServer
.
TrustRootCertificate
=
true
;
proxyServer
.
TrustRootCertificate
=
true
;
//
proxyServer.ForwardToUpstreamGateway = true;
proxyServer
.
ForwardToUpstreamGateway
=
true
;
//optionally set the Certificate Engine
//optionally set the Certificate Engine
//Under Mono only BouncyCastle will be supported
//Under Mono only BouncyCastle will be supported
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
be556d21
...
@@ -500,6 +500,23 @@ namespace Titanium.Web.Proxy
...
@@ -500,6 +500,23 @@ namespace Titanium.Web.Proxy
throw
new
Exception
(
"Proxy is already running."
);
throw
new
Exception
(
"Proxy is already running."
);
}
}
if
(
systemProxySettingsManager
!=
null
)
{
var
proxyInfo
=
systemProxySettingsManager
.
GetProxyInfoFromRegistry
();
if
(
proxyInfo
.
Proxies
!=
null
)
{
var
proxies
=
proxyInfo
.
Proxies
.
ToArray
();
foreach
(
var
proxy
in
proxies
)
{
var
value
=
proxy
.
Value
;
if
(
value
.
HostName
==
"127.0.0.1"
&&
ProxyEndPoints
.
Any
(
x
=>
x
.
Port
==
value
.
Port
))
{
systemProxySettingsManager
.
RemoveProxy
(
value
.
ProtocolType
);
}
}
}
}
if
(
ForwardToUpstreamGateway
if
(
ForwardToUpstreamGateway
&&
GetCustomUpStreamHttpProxyFunc
==
null
&&
GetCustomUpStreamHttpsProxyFunc
==
null
&&
GetCustomUpStreamHttpProxyFunc
==
null
&&
GetCustomUpStreamHttpsProxyFunc
==
null
&&
systemProxySettingsManager
!=
null
)
&&
systemProxySettingsManager
!=
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