DragonFruit.OnionFruit.Native.osx
14.5.3
dotnet add package DragonFruit.OnionFruit.Native.osx --version 14.5.3
NuGet\Install-Package DragonFruit.OnionFruit.Native.osx -Version 14.5.3
<PackageReference Include="DragonFruit.OnionFruit.Native.osx" Version="14.5.3" />
<PackageVersion Include="DragonFruit.OnionFruit.Native.osx" Version="14.5.3" />
<PackageReference Include="DragonFruit.OnionFruit.Native.osx" />
paket add DragonFruit.OnionFruit.Native.osx --version 14.5.3
#r "nuget: DragonFruit.OnionFruit.Native.osx, 14.5.3"
#:package DragonFruit.OnionFruit.Native.osx@14.5.3
#addin nuget:?package=DragonFruit.OnionFruit.Native.osx&version=14.5.3
#tool nuget:?package=DragonFruit.OnionFruit.Native.osx&version=14.5.3
OnionFruit Native Libraries
Provides native libraries from the Tor website as pacakges for supported operating systems
Example Locator Script
When publishing, the correct binaries are copied directly to the output folder. If in debug or non-publish build, the files can be found under
runtimes/{rid}/{arch}/native
public static class TorResolver
{
/// <summary>
/// Attempts to locate the tor executable, returning the full path if found.
/// </summary>
/// <remarks>
/// Currently not supported on linux platforms
/// </remarks>
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("linux")]
[UnsupportedOSPlatform("android")]
public static string LocateTorExecutable()
{
var filename = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "tor.exe" : "tor";
return EnumeratePotentialDirectories().Select(targetDir => Path.Combine(targetDir, filename)).FirstOrDefault(File.Exists);
}
private static IEnumerable<string> EnumeratePotentialDirectories()
{
// app dir (in case of published program)
yield return AppDomain.CurrentDomain.BaseDirectory;
// native executable location (debug/local build)
string platformName;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
platformName = "win";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
platformName = "osx";
}
else
{
throw new PlatformNotSupportedException("OnionFruit NativeLibs are currently only available on Windows and macOS");
}
var genericRid = $"{platformName}-{RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant()}";
yield return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "runtimes", genericRid, "native");
}
}
License
The project is licensed under the MIT Licence. Please note the Tor is distributed under a different license, which has been provided with the binaries
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on DragonFruit.OnionFruit.Native.osx:
Repository | Stars |
---|---|
dragonfruitnetwork/onionfruit
OnionFruit™ - Connect to the Tor network with minimal effort
|