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
29a3ecc1
Commit
29a3ecc1
authored
Jun 06, 2017
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the common remove proxy method. Unused internal methods removed.
parent
fc8576bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
40 deletions
+8
-40
SystemProxy.cs
Titanium.Web.Proxy/Helpers/SystemProxy.cs
+6
-28
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+2
-12
No files found.
Titanium.Web.Proxy/Helpers/SystemProxy.cs
View file @
29a3ecc1
...
...
@@ -71,37 +71,12 @@ namespace Titanium.Web.Proxy.Helpers
internal
const
int
InternetOptionSettingsChanged
=
39
;
internal
const
int
InternetOptionRefresh
=
37
;
internal
void
SetHttpProxy
(
string
hostname
,
int
port
)
{
SetProxy
(
hostname
,
port
,
ProxyProtocolType
.
Http
);
}
/// <summary>
/// Remove the http proxy setting from current machine
/// </summary>
internal
void
RemoveHttpProxy
()
{
RemoveProxy
(
ProxyProtocolType
.
Http
);
}
/// <summary>
/// Set the HTTPS proxy server for current machine
/// Set the HTTP
and/or HTTP
S proxy server for current machine
/// </summary>
/// <param name="hostname"></param>
/// <param name="port"></param>
internal
void
SetHttpsProxy
(
string
hostname
,
int
port
)
{
SetProxy
(
hostname
,
port
,
ProxyProtocolType
.
Https
);
}
/// <summary>
/// Removes the https proxy setting to nothing
/// </summary>
internal
void
RemoveHttpsProxy
()
{
RemoveProxy
(
ProxyProtocolType
.
Https
);
}
/// <param name="protocolType"></param>
internal
void
SetProxy
(
string
hostname
,
int
port
,
ProxyProtocolType
protocolType
)
{
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
...
...
@@ -141,6 +116,9 @@ namespace Titanium.Web.Proxy.Helpers
Refresh
();
}
/// <summary>
/// Remove the HTTP and/or HTTPS proxy setting from current machine
/// </summary>
internal
void
RemoveProxy
(
ProxyProtocolType
protocolType
)
{
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
...
...
@@ -150,7 +128,7 @@ namespace Titanium.Web.Proxy.Helpers
var
exisitingContent
=
reg
.
GetValue
(
"ProxyServer"
)
as
string
;
var
existingSystemProxyValues
=
GetSystemProxyValues
(
exisitingContent
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
(
protocolType
|
x
.
ProtocolType
)
!=
0
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
(
protocolType
&
x
.
ProtocolType
)
!=
0
);
if
(
existingSystemProxyValues
.
Count
!=
0
)
{
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
29a3ecc1
...
...
@@ -449,12 +449,7 @@ namespace Titanium.Web.Proxy
/// </summary>
public
void
DisableSystemHttpProxy
()
{
if
(
RunTime
.
IsRunningOnMono
)
{
throw
new
Exception
(
"Mono Runtime do not support system proxy settings."
);
}
systemProxySettingsManager
.
RemoveHttpProxy
();
DisableSystemProxy
(
ProxyProtocolType
.
Http
);
}
/// <summary>
...
...
@@ -462,12 +457,7 @@ namespace Titanium.Web.Proxy
/// </summary>
public
void
DisableSystemHttpsProxy
()
{
if
(
RunTime
.
IsRunningOnMono
)
{
throw
new
Exception
(
"Mono Runtime do not support system proxy settings."
);
}
systemProxySettingsManager
.
RemoveHttpsProxy
();
DisableSystemProxy
(
ProxyProtocolType
.
Https
);
}
/// <summary>
...
...
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