Skip to content

Commit 1b63929

Browse files
committed
✨ Http3
1 parent c8810f7 commit 1b63929

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Extensions/KestrelServerOptionsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static void ListenHttpsReverseProxy(this KestrelServerOptions options)
123123
var httpsPort = IReverseProxyConfig.HttpsPort;
124124
options.Listen(IReverseProxyService.Constants.Instance.ProxyIp, httpsPort, listen =>
125125
{
126-
listen.Protocols = HttpProtocols.Http1AndHttp2;
126+
listen.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
127127
listen.UseFlowAnalyze();
128128
listen.UseTls();
129129
});

src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/Http/ReverseProxyHttpClientHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
3636

3737
// 设置请求头 host,因为连接中已带端口号故 修改协议为 http
3838
request.Headers.Host = uri.Host;
39-
request.RequestUri = new UriBuilder(uri) { Scheme = Uri.UriSchemeHttp }.Uri;
39+
//request.RequestUri = new UriBuilder(uri) { Scheme = Uri.UriSchemeHttp }.Uri;
4040

4141
if (domainConfig.Timeout != null)
4242
{
@@ -61,6 +61,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
6161
AutomaticDecompression = DecompressionMethods.None,
6262
ConnectCallback = ConnectCallback,
6363
EnableMultipleHttp2Connections = true,
64+
EnableMultipleHttp3Connections = true,
6465
RequestHeaderEncodingSelector = (_, _) => Encoding.UTF8,
6566
ResponseHeaderEncodingSelector = (_, _) => Encoding.UTF8,
6667
};

src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/HttpServer/Middleware/HttpReverseProxyMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
143143
SetWattHeaders(context, reverseProxyConfig.Service.ServerSideProxyToken);
144144
forwarderRequestConfig = new ForwarderRequestConfig()
145145
{
146-
Version = GetHttpVersion(context.Request.Protocol),
147-
VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher
146+
Version = HttpVersion.Version30,
147+
VersionPolicy = HttpVersionPolicy.RequestVersionOrLower
148148
};
149149
}
150150
else

0 commit comments

Comments
 (0)