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 @@
"**/*.Basic.csproj/": true,
"**/*.Docs.csproj/": true,
"**/*.Proxy.csproj/": true,
"**/*.Proxy.csproj" : true
"**/*.Mono.csproj" : true
},
"search.exclude": {
"**/.build": true,
......@@ -32,6 +32,6 @@
"**/*.Basic.csproj/": true,
"**/*.Docs.csproj/": true,
"**/*.Proxy.csproj/": true,
"**/*.Proxy.csproj" : true
"**/*.Mono.csproj" : true
}
}
\ No newline at end of file
{
"fileOptions": {
"excludeSearchPatterns": [
"**/*.sln",
"**/*.Docs.csproj",
"**/tests/",
"**/Titanium.Web.Proxy.Examples.Wpf/",
......
......@@ -94,8 +94,6 @@ namespace Titanium.Web.Proxy
bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false,
bool trustRootCertificateAsAdmin = false)
{
// default values
ConnectionTimeOutSeconds = 60;
if (BufferPool == null)
{
......@@ -186,7 +184,7 @@ namespace Titanium.Web.Proxy
/// This will also determine the pool eviction time when connection pool is enabled.
/// Default value is 60 seconds.
/// </summary>
public int ConnectionTimeOutSeconds { get; set; }
public int ConnectionTimeOutSeconds { get; set; } = 60;
/// <summary>
/// Maximum number of concurrent connections per remote host in cache.
......
......@@ -207,7 +207,7 @@ namespace Titanium.Web.Proxy
//for connection pool, retry fails until cache is exhausted.
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 (request.UpgradeToWebSocket)
......@@ -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 (!request.ExpectationFailed)
{
......
......@@ -69,7 +69,7 @@ namespace Titanium.Web.Proxy
//it could cause floating server connections when client exits
prefetchConnectionTask = tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port,
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);
}
......@@ -102,7 +102,7 @@ namespace Titanium.Web.Proxy
{
var connection = await tcpConnectionFactory.GetServerConnection(httpsHostName, endPoint.Port,
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);
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