dotnet/runtime

HTTP/2 extended connect error message doesn't blame the server

Open

#111,470 创建于 2025年1月15日

在 GitHub 查看
 (9 评论) (0 反应) (0 负责人)C# (5,445 fork)batch import
area-System.Net.Httphelp wanted

仓库指标

Star
 (17,886 star)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

Description

System.Net.Http.HttpRequestException: Failed to establish web socket connection over HTTP/2 because extended CONNECT is not supported. Try to downgrade the request version to HTTP/1.1.

Reproduction Steps

Conect to a websocket with Extended Connect

Expected behavior

Work?

Actual behavior

Exception

Regression?

No response

Known Workarounds

No response

Configuration

   conection = new ClientWebSocket();

   conection.Options.SetRequestHeader("Stream-Type", ",mystream");
   conection.Options.HttpVersion = HttpVersion.Version30;

   await conection.ConnectAsync(new Uri(webSocketUri), Net.client, CancellationToken.None);

Other information

No response

贡献者指南