HttpProxy 2.0.0-alpha.1

This is a prerelease version of HttpProxy.
dotnet add package HttpProxy --version 2.0.0-alpha.1
                    
NuGet\Install-Package HttpProxy -Version 2.0.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HttpProxy" Version="2.0.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HttpProxy" Version="2.0.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="HttpProxy" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HttpProxy --version 2.0.0-alpha.1
                    
#r "nuget: HttpProxy, 2.0.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HttpProxy@2.0.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HttpProxy&version=2.0.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=HttpProxy&version=2.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

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: close for clean framing.
  • Built on System.IO.Pipelines for 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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