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
1002511c
Commit
1002511c
authored
Dec 08, 2017
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include exception data when listener faield to start
parent
09bcfe29
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+2
-2
EndPoint.cs
Titanium.Web.Proxy/Models/EndPoint.cs
+1
-3
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+15
-4
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
1002511c
Titanium.Web.Proxy/Models/EndPoint.cs
View file @
1002511c
...
...
@@ -26,7 +26,6 @@ namespace Titanium.Web.Proxy.Models
EnableSsl
=
enableSsl
;
}
/// <summary>
/// underlying TCP Listener object
/// </summary>
...
...
@@ -53,7 +52,6 @@ namespace Titanium.Web.Proxy.Models
public
bool
IpV6Enabled
=>
Equals
(
IpAddress
,
IPAddress
.
IPv6Any
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6Loopback
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6None
);
}
/// <summary>
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
1002511c
...
...
@@ -646,12 +646,23 @@ namespace Titanium.Web.Proxy
private
void
Listen
(
ProxyEndPoint
endPoint
)
{
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
try
{
endPoint
.
Listener
.
Start
();
endPoint
.
Port
=
((
IPEndPoint
)
endPoint
.
Listener
.
LocalEndpoint
).
Port
;
// accept clients asynchronously
endPoint
.
Listener
.
BeginAcceptTcpClient
(
OnAcceptConnection
,
endPoint
);
}
catch
(
SocketException
ex
)
{
var
pex
=
new
Exception
(
$"Endpoint
{
endPoint
}
failed to start. Check inner exception and exception data for details."
,
ex
);
pex
.
Data
.
Add
(
"ipAddress"
,
endPoint
.
IpAddress
);
pex
.
Data
.
Add
(
"port"
,
endPoint
.
Port
);
throw
pex
;
}
}
/// <summary>
/// Verifiy if its safe to set this end point as System proxy
...
...
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