HttpProxy 2.0.0-alpha.1
dotnet add package HttpProxy --version 2.0.0-alpha.1
NuGet\Install-Package HttpProxy -Version 2.0.0-alpha.1
<PackageReference Include="HttpProxy" Version="2.0.0-alpha.1" />
<PackageVersion Include="HttpProxy" Version="2.0.0-alpha.1" />
<PackageReference Include="HttpProxy" />
paket add HttpProxy --version 2.0.0-alpha.1
#r "nuget: HttpProxy, 2.0.0-alpha.1"
#:package HttpProxy@2.0.0-alpha.1
#addin nuget:?package=HttpProxy&version=2.0.0-alpha.1&prerelease
#tool nuget:?package=HttpProxy&version=2.0.0-alpha.1&prerelease
HttpProxy
An IStreamInbound implementation that speaks the HTTP proxy protocol, supporting both CONNECT tunneling and plain HTTP forwarding.
Key Features
- Handles HTTP
CONNECT(tunneling) and regular HTTP request forwarding. - Optional Basic authentication via
HttpProxyCredential. - Rewrites headers on the fly — strips proxy-specific headers and forces
Connection: closefor clean framing. - Built on
System.IO.Pipelinesfor high-performance, zero-copy I/O where possible. - Pluggable outbound via
IOutbound— connect directly or chain through another proxy.
Main Types
HttpInbound
public partial class HttpInbound : IStreamInbound
{
public HttpInbound(HttpProxyCredential? credential = null, ILogger<HttpInbound>? logger = null);
public ValueTask HandleAsync(InboundContext context, IDuplexPipe clientPipe, IOutbound outbound, CancellationToken cancellationToken = default);
}
Forwards HTTP requests through a configurable outbound connector, rewriting headers on the fly. Reads the request from clientPipe, authenticates the client when credentials are configured, connects to the target host via outbound, and relays traffic bidirectionally.
For CONNECT requests, sends 200 Connection Established and then links the two pipes directly. For plain HTTP requests, filters hop-by-hop headers and rewrites the request URI to origin-form before forwarding.
HttpProxyCredential
public sealed record HttpProxyCredential(string UserName, string Password);
Credentials for HTTP proxy authentication (Basic scheme). When supplied to HttpInbound, clients must present matching Proxy-Authorization headers or receive 407 Proxy Authentication Required.
HttpUtils
public static partial class HttpUtils
{
public static ReadOnlySpan<byte> HttpHeaderEnd { get; } // \r\n\r\n
public static ReadOnlySpan<byte> HttpNewLine { get; } // \r\n
public static bool IsHttpHeader(this ReadOnlySequence<byte> buffer);
}
Low-level HTTP header parsing and rewriting utilities operating directly on byte spans. IsHttpHeader is an extension method on ReadOnlySequence<byte> that checks whether the buffer contains a complete HTTP header block (terminated by \r\n\r\n) with a valid request line.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Pipelines.Extensions (>= 2.0.0-alpha.1)
- Proxy.Abstractions (>= 2.0.0-alpha.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-alpha.1 | 0 | 4/13/2026 |
| 1.1.0 | 153 | 10/4/2025 |
| 1.0.2 | 1,496 | 9/14/2023 |
| 1.0.1 | 493 | 6/16/2023 |
| 1.0.0 | 3,257 | 11/9/2021 |
| 0.9.9 | 1,701 | 9/20/2021 |
| 0.9.8 | 805 | 9/1/2021 |
| 0.9.7 | 661 | 8/27/2021 |
| 0.9.6 | 659 | 8/25/2021 |
| 0.9.5 | 661 | 8/22/2021 |
| 0.9.4 | 990 | 8/13/2021 |
| 0.9.3 | 715 | 8/8/2021 |
| 0.9.2 | 606 | 8/6/2021 |
| 0.9.1 | 561 | 8/4/2021 |
| 0.9.1-alpha | 450 | 8/3/2021 |