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
83377610
Unverified
Commit
83377610
authored
Dec 08, 2017
by
honfika
Committed by
GitHub
Dec 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #343 from justcoding121/develop
Include exception data when listener faield to start
parents
5c7f112d
18dafe56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+0
-1
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 @
83377610
...
...
@@ -89,7 +89,6 @@ namespace Titanium.Web.Proxy.Examples.Basic
proxyServer
.
AddEndPoint
(
explicitEndPoint
);
proxyServer
.
Start
();
//Transparent endpoint is useful for reverse proxy (client is not aware of the existence of proxy)
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets or DNS
//to send data to this endPoint
...
...
Titanium.Web.Proxy/Models/EndPoint.cs
View file @
83377610
...
...
@@ -25,8 +25,7 @@ namespace Titanium.Web.Proxy.Models
Port
=
port
;
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 @
83377610
...
...
@@ -646,11 +646,22 @@ namespace Titanium.Web.Proxy
private
void
Listen
(
ProxyEndPoint
endPoint
)
{
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
endPoint
.
Listener
.
Start
();
try
{
endPoint
.
Listener
.
Start
();
endPoint
.
Port
=
((
IPEndPoint
)
endPoint
.
Listener
.
LocalEndpoint
).
Port
;
// accept clients asynchronously
endPoint
.
Listener
.
BeginAcceptTcpClient
(
OnAcceptConnection
,
endPoint
);
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>
...
...
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