Commit d11fec92 authored by ilushka85's avatar ilushka85

pass ConnectHeaders

parent 26aea8a8
...@@ -56,6 +56,9 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -56,6 +56,9 @@ namespace Titanium.Web.Proxy.EventArguments
public ExternalProxy CustomUpStreamHttpsProxyUsed { get; set; } public ExternalProxy CustomUpStreamHttpsProxyUsed { get; set; }
/// <summary> /// <summary>
/// Constructor to initialize the proxy /// Constructor to initialize the proxy
/// </summary> /// </summary>
......
...@@ -19,6 +19,8 @@ namespace Titanium.Web.Proxy.Http ...@@ -19,6 +19,8 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
internal TcpConnection ServerConnection { get; set; } internal TcpConnection ServerConnection { get; set; }
public List<HttpHeader> ConnectHeaders { get; set; }
public Request Request { get; set; } public Request Request { get; set; }
public Response Response { get; set; } public Response Response { get; set; }
......
...@@ -294,7 +294,7 @@ namespace Titanium.Web.Proxy ...@@ -294,7 +294,7 @@ namespace Titanium.Web.Proxy
//Now create the request //Now create the request
await HandleHttpSessionRequest(tcpClient, httpCmd, clientStream, clientStreamReader, clientStreamWriter, await HandleHttpSessionRequest(tcpClient, httpCmd, clientStream, clientStreamReader, clientStreamWriter,
endPoint.EnableSsl ? endPoint.GenericCertificateName : null,null); endPoint.EnableSsl ? endPoint.GenericCertificateName : null, null);
} }
/// <summary> /// <summary>
/// This is the core request handler method for a particular connection from client /// This is the core request handler method for a particular connection from client
...@@ -442,10 +442,7 @@ namespace Titanium.Web.Proxy ...@@ -442,10 +442,7 @@ namespace Titanium.Web.Proxy
{ {
if (GetCustomUpStreamHttpsProxyFunc != null) if (GetCustomUpStreamHttpsProxyFunc != null)
{ {
foreach (var header in args.WebSession.Request.RequestHeaders.Values) args.WebSession.ConnectHeaders = connectHeaders;
{
connectHeaders.Add(header);
}
customUpStreamHttpsProxy = await GetCustomUpStreamHttpsProxyFunc(args).ConfigureAwait(false); customUpStreamHttpsProxy = await GetCustomUpStreamHttpsProxyFunc(args).ConfigureAwait(false);
} }
} }
...@@ -462,7 +459,7 @@ namespace Titanium.Web.Proxy ...@@ -462,7 +459,7 @@ namespace Titanium.Web.Proxy
} }
else else
{ {
if(connection.IsHttps) if (connection.IsHttps)
{ {
args.CustomUpStreamHttpsProxyUsed = connection.UpStreamHttpsProxy; args.CustomUpStreamHttpsProxyUsed = connection.UpStreamHttpsProxy;
......
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