![]() |
VOOZH | about |
dotnet add package Pouyan.SingBox --version 1.0.0.11
NuGet\Install-Package Pouyan.SingBox -Version 1.0.0.11
<PackageReference Include="Pouyan.SingBox" Version="1.0.0.11" />
<PackageVersion Include="Pouyan.SingBox" Version="1.0.0.11" />Directory.Packages.props
<PackageReference Include="Pouyan.SingBox" />Project file
paket add Pouyan.SingBox --version 1.0.0.11
#r "nuget: Pouyan.SingBox, 1.0.0.11"
#:package Pouyan.SingBox@1.0.0.11
#addin nuget:?package=Pouyan.SingBox&version=1.0.0.11Install as a Cake Addin
#tool nuget:?package=Pouyan.SingBox&version=1.0.0.11Install as a Cake Tool
<div align="center">
Configure and run sing-box with ease.
Based on sing-box's official documentation.
</div>
for more configuration examples, including Route Rules or Dns configuration, please refer to sing-box's official documentation.
var mixedInbound = Pouyan.SingBox.Inbound.CreateMixedInbound(
listen:"127.0.0.1",
listenPort: 3080
);
var tunInbound = Pouyan.SingBox.Inbound.CreateTunInbound();
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();
sing-box you first need to obtain it's executable from its original repository.Tunnel's constructor.var singbox = new Pouyan.SingBox.Tunnel("sing-box.exe", [mixedInbound]);
CancellationToken to the SingBoxWrapper.StartAsync method, if you cancel it, the sing-box proccess will end. this parameter is optional.var cts = new CancellationTokenSource();
singbox.StartAsync(myProfile, cts, (sender , log) =>
{
Console.WriteLine(log);
});
var profiles = SingBox.GetProfile.GetProfilesFromSubscribe(url);
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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.