WSTunnel 1.0.0

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

// Install WSTunnel as a Cake Tool
#tool nuget:?package=WSTunnel&version=1.0.0                

WSTunnel

运行在 asp.net core 上,基于 WebSocket 的隧道

使用

服务端配置

引用包

dotnet add package WSTunnel

配置服务

// 添加命名空间
using WSTunnel;

var builder = WebApplication.CreateBuilder(args);

//添加隧道服务
builder.Services.AddWSTunnel();
// Add services to the container.

var app = builder.Build();

//开启 WebSocket 支持
app.UseWebSockets();

// 修改参数加密密码,用于认证。建议修改下。
// TunnelParam.param_key = System.Text.Encoding.UTF8.GetBytes("azleKxOgDmp4wV7l");

//绑定 WebSocket 路径,目前为 /ws,建议修改为其他。
app.MapGet("/ws", WSTunnelRequestDelegate.Request);

app.Run();

客户端运行参数

wsclient.exe --help
Description:
  WebSocket 隧道客户端

Usage:
  WSClient [options]

Options:
  -s, --server <server> (REQUIRED)  目标服务器地址。
                                    示例:wss://myserver.com/ws/mqtt
  -t, --tunnel <tunnel> (REQUIRED)  隧道配置,允许配置多个。
                                    格式:[bind_address:]bind_port:target_server:target_port
                                    示例:0.0.0.0:12345:github.com:22
                                    等效于: 12345:github.com:22
                                         bind_address:127.0.0.1 监听地址,为空默认为 0.0.0.0。
                                         bind_port: 12345 监听端口。
                                         target_server: github.com 目标服务器地址。
                                         target_port: 22 目标服务器端口。
  -k, --key <key>                   认证密钥,长度是16个字符。
  --version                         Show version information
  -?, -h, --help                    Show help and usage information

使用示例:

wsclient.exe --server ws://localhost:5111/ws --tunnel 12345:github.com:222
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 259 4/18/2022