EzNetProxy 1.0.0

.NET 6.0
Install-Package EzNetProxy -Version 1.0.0
dotnet add package EzNetProxy --version 1.0.0
<PackageReference Include="EzNetProxy" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EzNetProxy --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EzNetProxy, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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.0.0

// Install EzNetProxy as a Cake Tool
#tool nuget:?package=EzNetProxy&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

EzNetProxy

C# dotnet6.0 License-MIT

A library to simplify proxy usage in .NET 6+


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 6+
  • 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 = ...;
var httpProxy = ProxyClient.Parse(ProxyType.HTTP, proxy);
...

Method #3:

using EzNetProxy.Modals;

var data = new ProxyData
{
    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(PeoxyType.HTTP, "q.webshare.io:80");

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

using var client = new HttpClient(httpClientHandler, true);

var res = await client.GetAsync("https://wtfismyip.com/text");
var str = await res.Content.ReadAsStringAsync();

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 Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net6.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.0.0 57 6/11/2022