diff --git a/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs index 7d7f5f30a..918368f47 100644 --- a/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs @@ -517,15 +517,17 @@ internal Task GetServerConnection(ProxyServer proxyServer, if (externalProxy != null && externalProxy.ProxyType == ExternalProxyType.Http && (isConnect || isHttps)) { - var authority = $"{remoteHostName}:{remotePort}".GetByteString(); - var connectRequest = new ConnectRequest(authority) + var authority = $"{remoteHostName}:{remotePort}"; + var authorityBytes = authority.GetByteString(); + var connectRequest = new ConnectRequest(authorityBytes) { IsHttps = isHttps, - RequestUriString8 = authority, + RequestUriString8 = authorityBytes, HttpVersion = httpVersion }; connectRequest.Headers.AddHeader(KnownHeaders.Connection, KnownHeaders.ConnectionKeepAlive); + connectRequest.Headers.AddHeader(KnownHeaders.Host, authority); if (!string.IsNullOrEmpty(externalProxy.UserName) && externalProxy.Password != null) {