dotnet / dotnet/aspnetcore

Allowing HTTP CONNECT requests

Open
#21,953 1 comment 7 reactions 0 assignees View on GitHub
affected-very-few area-networking enhancement feature-kestrel severity-nice-to-have
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is your feature request related to a problem? Please describe.
I am writing an HTTP proxy server using ASP.NET Core. To handle HTTP `CONNECT` requests I would like to upgrade the request to its underlying stream and pipe it directly to the destination server. However it seems that upgrading non-upgrade requests is not supported and will throw an exception instead.

### Describe the solution you'd like
Consider adding a `force` parameter like `IHttpUpgradeFeature.UpgradeAsync(bool force = false)` that will upgrade the connection regardless of the presence of the upgrade header. Or to maintain backward compatibility, add a separate feature interface that will do this.

### Additional context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.