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
Hide 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
...
@@ -87,8 +87,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -87,8 +87,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
//An explicit endpoint is where the client knows about the existence of a proxy
//An explicit endpoint is where the client knows about the existence of a proxy
//So client sends request in a proxy friendly manner
//So client sends request in a proxy friendly manner
proxyServer
.
AddEndPoint
(
explicitEndPoint
);
proxyServer
.
AddEndPoint
(
explicitEndPoint
);
proxyServer
.
Start
();
proxyServer
.
Start
();
//Transparent endpoint is useful for reverse proxy (client is not aware of the existence of proxy)
//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
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets or DNS
...
...
Titanium.Web.Proxy/Models/EndPoint.cs
View file @
1002511c
...
@@ -25,8 +25,7 @@ namespace Titanium.Web.Proxy.Models
...
@@ -25,8 +25,7 @@ namespace Titanium.Web.Proxy.Models
Port
=
port
;
Port
=
port
;
EnableSsl
=
enableSsl
;
EnableSsl
=
enableSsl
;
}
}
/// <summary>
/// <summary>
/// underlying TCP Listener object
/// underlying TCP Listener object
/// </summary>
/// </summary>
...
@@ -53,7 +52,6 @@ namespace Titanium.Web.Proxy.Models
...
@@ -53,7 +52,6 @@ namespace Titanium.Web.Proxy.Models
public
bool
IpV6Enabled
=>
Equals
(
IpAddress
,
IPAddress
.
IPv6Any
)
public
bool
IpV6Enabled
=>
Equals
(
IpAddress
,
IPAddress
.
IPv6Any
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6Loopback
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6Loopback
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6None
);
||
Equals
(
IpAddress
,
IPAddress
.
IPv6None
);
}
}
/// <summary>
/// <summary>
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
1002511c
...
@@ -646,11 +646,22 @@ namespace Titanium.Web.Proxy
...
@@ -646,11 +646,22 @@ namespace Titanium.Web.Proxy
private
void
Listen
(
ProxyEndPoint
endPoint
)
private
void
Listen
(
ProxyEndPoint
endPoint
)
{
{
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
endPoint
.
Listener
.
Start
();
try
{
endPoint
.
Listener
.
Start
();
endPoint
.
Port
=
((
IPEndPoint
)
endPoint
.
Listener
.
LocalEndpoint
).
Port
;
endPoint
.
Port
=
((
IPEndPoint
)
endPoint
.
Listener
.
LocalEndpoint
).
Port
;
// accept clients asynchronously
endPoint
.
Listener
.
BeginAcceptTcpClient
(
OnAcceptConnection
,
endPoint
);
// 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>
/// <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