Unverified Commit 08167b4d authored by Jehonathan Thomas's avatar Jehonathan Thomas Committed by GitHub

Merge pull request #496 from justcoding121/master

Dns resolve from code
parents c3fc1d35 fb33defa
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"**/*.Basic.csproj/": true, "**/*.Basic.csproj/": true,
"**/*.Docs.csproj/": true, "**/*.Docs.csproj/": true,
"**/*.Proxy.csproj/": true, "**/*.Proxy.csproj/": true,
"**/*.Proxy.csproj" : true "**/*.Mono.csproj" : true
}, },
"search.exclude": { "search.exclude": {
"**/.build": true, "**/.build": true,
...@@ -32,6 +32,6 @@ ...@@ -32,6 +32,6 @@
"**/*.Basic.csproj/": true, "**/*.Basic.csproj/": true,
"**/*.Docs.csproj/": true, "**/*.Docs.csproj/": true,
"**/*.Proxy.csproj/": true, "**/*.Proxy.csproj/": true,
"**/*.Proxy.csproj" : true "**/*.Mono.csproj" : true
} }
} }
\ No newline at end of file
{ {
"fileOptions": { "fileOptions": {
"excludeSearchPatterns": [ "excludeSearchPatterns": [
"**/*.sln",
"**/*.Docs.csproj", "**/*.Docs.csproj",
"**/tests/", "**/tests/",
"**/Titanium.Web.Proxy.Examples.Wpf/", "**/Titanium.Web.Proxy.Examples.Wpf/",
......
...@@ -94,8 +94,6 @@ namespace Titanium.Web.Proxy ...@@ -94,8 +94,6 @@ namespace Titanium.Web.Proxy
bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false,
bool trustRootCertificateAsAdmin = false) bool trustRootCertificateAsAdmin = false)
{ {
// default values
ConnectionTimeOutSeconds = 60;
if (BufferPool == null) if (BufferPool == null)
{ {
...@@ -186,7 +184,7 @@ namespace Titanium.Web.Proxy ...@@ -186,7 +184,7 @@ namespace Titanium.Web.Proxy
/// This will also determine the pool eviction time when connection pool is enabled. /// This will also determine the pool eviction time when connection pool is enabled.
/// Default value is 60 seconds. /// Default value is 60 seconds.
/// </summary> /// </summary>
public int ConnectionTimeOutSeconds { get; set; } public int ConnectionTimeOutSeconds { get; set; } = 60;
/// <summary> /// <summary>
/// Maximum number of concurrent connections per remote host in cache. /// Maximum number of concurrent connections per remote host in cache.
......
...@@ -207,7 +207,7 @@ namespace Titanium.Web.Proxy ...@@ -207,7 +207,7 @@ namespace Titanium.Web.Proxy
//for connection pool, retry fails until cache is exhausted. //for connection pool, retry fails until cache is exhausted.
var result = await retryPolicy<ServerConnectionException>().ExecuteAsync(async (serverConnection) => var result = await retryPolicy<ServerConnectionException>().ExecuteAsync(async (serverConnection) =>
{ {
args.TimeLine["Server Connection Created"] = DateTime.Now; args.TimeLine["Connection Ready"] = DateTime.Now;
// if upgrading to websocket then relay the request without reading the contents // if upgrading to websocket then relay the request without reading the contents
if (request.UpgradeToWebSocket) if (request.UpgradeToWebSocket)
...@@ -369,6 +369,8 @@ namespace Titanium.Web.Proxy ...@@ -369,6 +369,8 @@ namespace Titanium.Web.Proxy
} }
} }
args.TimeLine["Request Sent"] = DateTime.Now;
// If not expectation failed response was returned by server then parse response // If not expectation failed response was returned by server then parse response
if (!request.ExpectationFailed) if (!request.ExpectationFailed)
{ {
......
...@@ -69,7 +69,7 @@ namespace Titanium.Web.Proxy ...@@ -69,7 +69,7 @@ namespace Titanium.Web.Proxy
//it could cause floating server connections when client exits //it could cause floating server connections when client exits
prefetchConnectionTask = tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port, prefetchConnectionTask = tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port,
httpVersion: null, isHttps: true, applicationProtocols: null, isConnect: false, httpVersion: null, isHttps: true, applicationProtocols: null, isConnect: false,
proxyServer: this, upStreamEndPoint: UpStreamEndPoint, externalProxy: UpStreamHttpsProxy, proxyServer: this, session: null, upStreamEndPoint: UpStreamEndPoint, externalProxy: UpStreamHttpsProxy,
noCache: false, cancellationToken: CancellationToken.None); noCache: false, cancellationToken: CancellationToken.None);
} }
...@@ -102,7 +102,7 @@ namespace Titanium.Web.Proxy ...@@ -102,7 +102,7 @@ namespace Titanium.Web.Proxy
{ {
var connection = await tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port, var connection = await tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port,
httpVersion: null, isHttps: false, applicationProtocols: null, httpVersion: null, isHttps: false, applicationProtocols: null,
isConnect: true, proxyServer: this, upStreamEndPoint: UpStreamEndPoint, isConnect: true, proxyServer: this, session:null, upStreamEndPoint: UpStreamEndPoint,
externalProxy: UpStreamHttpsProxy, noCache: true, cancellationToken: cancellationToken); externalProxy: UpStreamHttpsProxy, noCache: true, cancellationToken: cancellationToken);
try try
......
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