EzNetProxy 1.1.0

dotnet add package EzNetProxy --version 1.1.0
NuGet\Install-Package EzNetProxy -Version 1.1.0
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="EzNetProxy" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EzNetProxy --version 1.1.0
#r "nuget: EzNetProxy, 1.1.0"
#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.
// Install EzNetProxy as a Cake Addin
#addin nuget:?package=EzNetProxy&version=1.1.0

// Install EzNetProxy as a Cake Tool
#tool nuget:?package=EzNetProxy&version=1.1.0

EzNetProxy

C# dotnet6.0 License-MIT

A library to simplify proxy usage in .NET 7+


Usage

  1. Install package via Nuget or some other method
  2. Import modules: using EzNetProxy;
  3. Use your preferred way to parse the proxy connection information.

Notes:

  • Requires .NET 7+
  • Backbone connections supported
  • ipv6 works (backbone connection)

Supported proxy formats:

  • host:port
  • host:port:user:pw
  • user:pw@host:port

Method #1:

var httpProxy = ProxyClient.Parse("http://host:port");
var socks4Proxy = ProxyClient.Parse("socks4://host:port:user:pw");
var socks4aProxy = ProxyClient.Parse("socks4a://user:pw@host:port");
var socks5Proxy = ProxyClient.Parse("socks5://host:port");

Method #2:

string proxy = "123.123.123.123:8080";
var httpProxy = ProxyClient.Parse(ProxyType.HTTP, proxy);
...

Method #3:

using EzNetProxy.Modals;

ProxyData data = new()
{
    Type = ProxyType.HTTP,
    Ip = "pornhub.com",
    Port = 80,
    Username = "username",
    Password = "password"
};

var proxy = ProxyClient.Parse(data);

You can also use Fiddler's debugging proxy by:

var proxy = ProxyClient.DebugFiddler();

Here is a simple example:

// backbone connection; ipv4; 104.227.XXX.XXX
var proxy = ProxyClient.Parse(ProxyType.HTTP, "q.webshare.io:80");

HttpClientHandler httpClientHandler = new()
{
  Proxy = proxy,
  UseProxy = true // IMPORTANT!
};

using HttpClient client = new(httpClientHandler, true);

var str = await client.GetStringAsync("https://wtfismyip.com/text");

Console.WriteLine(str);
// str = 104.227.XXX.XXX


This project is inspired by xNet; the project is no longer maintained by its creator and even many forks of the project, such as Leaf.xNet. One of the main reasons why xNet was treasured was for its support of many proxy protocols, such as Socks-4 and Socks-5, and how simple it was to use. Hopefully, this project can be an excellent replacement for one part of the project — simple proxy usage.

Please check my profile if you'd like to contact me.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

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
1.1.0 117 10/6/2023
1.0.0 208 6/11/2022