VOOZH about

URL: https://www.nuget.org/packages/Pouyan.SingBox/

⇱ NuGet Gallery | Pouyan.SingBox 1.0.0.11




Pouyan.SingBox 1.0.0.11

dotnet add package Pouyan.SingBox --version 1.0.0.11
 
 
NuGet\Install-Package Pouyan.SingBox -Version 1.0.0.11
 
 
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="Pouyan.SingBox" Version="1.0.0.11" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pouyan.SingBox" Version="1.0.0.11" />
 
Directory.Packages.props
<PackageReference Include="Pouyan.SingBox" />
 
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 Pouyan.SingBox --version 1.0.0.11
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Pouyan.SingBox, 1.0.0.11"
 
 
#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 Pouyan.SingBox@1.0.0.11
 
 
#: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=Pouyan.SingBox&version=1.0.0.11
 
Install as a Cake Addin
#tool nuget:?package=Pouyan.SingBox&version=1.0.0.11
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<div align="center">

Pouyan.SingBox

Template project: GitHub

Configure and run sing-box with ease.
Based on sing-box's official documentation.

👁 Nuget
👁 Nuget

</div>

Configuration examples

for more configuration examples, including Route Rules or Dns configuration, please refer to sing-box's official documentation.

Mixed inbound:

var mixedInbound = Pouyan.SingBox.Inbound.CreateMixedInbound(
 listen:"127.0.0.1",
 listenPort: 3080
 );

Tun inbound:

  • Please note that tun inbound requires your app to have administrator privileges.
var tunInbound = Pouyan.SingBox.Inbound.CreateTunInbound();

Parse outbound profiles:

var myProfileUrl = "trojan://myLovelyPassword@myserver.server:443?security=tls&sni=mySni&type=grpc&serviceName=myGrpcPath#MyTrojanServer";
var myProfile = ProfileParser.ParseProfileUrl(myProfileUrl);

Additionally you can convert parsed profiles back to string url:

var myProfileUrl = myProfile.ToProfileUrl();

Running

  • In order to use this library for running sing-box you first need to obtain it's executable from its original repository.
  • You need to have the path to this executable and pass it to Tunnel's constructor.
var singbox = new Pouyan.SingBox.Tunnel("sing-box.exe", [mixedInbound]);
  • you can pass a CancellationToken to the SingBoxWrapper.StartAsync method, if you cancel it, the sing-box proccess will end. this parameter is optional.
  • if you need sing-box's logs, you need to subscribe to the Onlog event (optional).
var cts = new CancellationTokenSource();
singbox.StartAsync(myProfile, cts, (sender , log) =>
{
 Console.WriteLine(log);
});

Take outbounds from subscribe:

var profiles = SingBox.GetProfile.GetProfilesFromSubscribe(url);

Url testing

You can use UrlTestAsync classes to easily test if the proxies are healthy and valid

var myProfileUrl = "trojan://myLovelyPassword@myserver.server:443?security=tls&sni=mySni&type=grpc&serviceName=myGrpcPath#MyTrojanServer";
var myProfile = ProfileParser.ParseProfileUrl(myProfileUrl);

var profileTester = new ProfileTester("sing-box.exe");

var test = await profileTester.UrlTestAsync(myProfile, 7087);

Console.WriteLine($"Success: {test.Result.Success}, Delay: {test.Result.Delay}");

List<ProfileItem>:

var test = await profileTester.UrlTestAsync(profiles);
Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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
1.0.0.11 262 8/19/2025
1.0.0.10 285 9/21/2024
1.0.0.9 218 8/29/2024
1.0.0.8 215 8/23/2024
1.0.0.7 218 8/12/2024
1.0.0.6 202 7/20/2024
1.0.0.5 190 7/17/2024
1.0.0.4 235 7/17/2024
1.0.0.3 207 6/19/2024
1.0.0.2 208 6/19/2024
1.0.0.1 211 6/17/2024
1.0.0 223 6/1/2024