Commit b7b7adc9 authored by Honfika's avatar Honfika

format

parent 4843bceb
...@@ -287,7 +287,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -287,7 +287,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
// deny connection to proxy end points to avoid infinite connection loop. // deny connection to proxy end points to avoid infinite connection loop.
if (Server.ProxyEndPoints.Any(x => x.Port == remotePort) if (Server.ProxyEndPoints.Any(x => x.Port == remotePort)
&& NetworkHelper.IsLocalIpAddress(remoteHostName)) && NetworkHelper.IsLocalIpAddress(remoteHostName))
{ {
throw new Exception($"A client is making HTTP request to one of the listening ports of this proxy {remoteHostName}:{remotePort}"); throw new Exception($"A client is making HTTP request to one of the listening ports of this proxy {remoteHostName}:{remotePort}");
...@@ -334,7 +334,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -334,7 +334,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
bool retry = true; bool retry = true;
var enabledSslProtocols = sslProtocol; var enabledSslProtocols = sslProtocol;
retry: retry:
try try
{ {
bool socks = externalProxy != null && externalProxy.ProxyType != ExternalProxyType.Http; bool socks = externalProxy != null && externalProxy.ProxyType != ExternalProxyType.Http;
...@@ -807,8 +807,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -807,8 +807,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
return ((ProxySocket.ProxySocket)state).BeginConnect(address, port, requestCallback, state); return ((ProxySocket.ProxySocket)state).BeginConnect(address, port, requestCallback, state);
} }
static IAsyncResult beginConnect(string hostName, int port, AsyncCallback requestCallback, static IAsyncResult beginConnect(string hostName, int port, AsyncCallback requestCallback, object state)
object state)
{ {
return ((ProxySocket.ProxySocket)state).BeginConnect(hostName, port, requestCallback, state); return ((ProxySocket.ProxySocket)state).BeginConnect(hostName, port, requestCallback, state);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment