Commit 190da80f authored by justcoding121's avatar justcoding121

add TODO comments

parent 7747e583
...@@ -135,14 +135,15 @@ namespace Titanium.Web.Proxy ...@@ -135,14 +135,15 @@ namespace Titanium.Web.Proxy
{ {
// test server HTTP/2 support // test server HTTP/2 support
// todo: this is a hack, because Titanium does not support HTTP protocol changing currently // todo: this is a hack, because Titanium does not support HTTP protocol changing currently
// When connection pool becomes stable we can connect to server preemptively in a separate task here without awaiting
// using HTTPS CONNECT hostname. Then by releasing server connection
// back to connection pool we can authenticate against client/server concurrently and save time.
var connection = await getServerConnection(connectArgs, true, var connection = await getServerConnection(connectArgs, true,
SslExtensions.Http2ProtocolAsList, cancellationToken); SslExtensions.Http2ProtocolAsList, cancellationToken);
http2Supported = connection.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2; http2Supported = connection.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2;
//release connection back to pool intead of closing when connection pool is enabled //release connection back to pool intead of closing when connection pool is enabled.
//In future we can connect to server preemptively here for all HTTPS connections using connect hostname
//and then release it back to pool so that we can save time when reading client headers
await tcpConnectionFactory.Release(connection, !EnableConnectionPool); await tcpConnectionFactory.Release(connection, !EnableConnectionPool);
} }
......
...@@ -61,6 +61,11 @@ namespace Titanium.Web.Proxy ...@@ -61,6 +61,11 @@ namespace Titanium.Web.Proxy
{ {
SslStream sslStream = null; SslStream sslStream = null;
// When connection pool becomes stable we can connect to server preemptively in a separate task here without awaiting
// for all HTTPS requests using SNI hostname. Then by releasing server connection
// back to connection pool we can authenticate against client/server concurrently and save time.
//do client authentication using fake certificate
try try
{ {
sslStream = new SslStream(clientStream); sslStream = new SslStream(clientStream);
......
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