FastTunnel.Core 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FastTunnel.Core --version 1.0.0
NuGet\Install-Package FastTunnel.Core -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="FastTunnel.Core" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FastTunnel.Core --version 1.0.0
#r "nuget: FastTunnel.Core, 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 FastTunnel.Core as a Cake Addin
#addin nuget:?package=FastTunnel.Core&version=1.0.0

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

<p align="center"><img src="images/logo.png" width="150" align=center /></p>

FastTunnel -内网穿透利器

README | 中文文档

PRs Welcome Build status License CircleCI

What is FastTunnel?

FastTunnel是一款高性能跨平台内网穿透工具,使用它可以实现在公网上访问您的内网服务。

演示地址 https://suidao.io

有帮助的朋友给个:star:支持一下,万分感谢:relaxed::relaxed::relaxed:

What can FastTunel do?

  • 远程内网计算机 Windows/Linux/Mac
  • 用自定义域名访问内网web服务(常用于微信开发)
  • 端口转发/端口映射,访问内网任意端口提供的服务 mysql、redis、ftp等等
  • Support any other domain names overlay current binding
  • p2p穿透

Quickstart

  1. releases 页面下载对应的程序
  2. 根据自己的需求修改配置文件appsettings.json
  3. 服务端运行FastTunnel.Server
  4. 客户端运行FastTunnel.Cient

Run on Linux/Mac os?

Windows

直接双击 FastTunnel.Client.exe Ready to run

Linux

chmod +x FastTunnel.Client
.\FastTunnel.Client

Mac

直接运行 FastTunnel.Client

配置示例

1. 用自定义域名访问内网web服务

  • 例如你拥有一个服务器,公网ip地址为 110.110.110.110 ,同时你有一个顶级域名为 abc.com 的域名,你希望访问 test.abc.com可以访问内网的一个网站。
  • 你需要新增一个域名地址的DNS解析,类型为A,名称为 * , ipv4地址为 110.110.110.110 ,这样 *.abc.com的域名均会指向110.110.110.110的服务器,由于FastTunnel默认监听的http端口为1270,所以要访问http://test.abc.com:1270
  • 如果不希望每次访问都带上端口号,可以通过nginx转发实现。
http {
    # 添加resolver 
    resolver 8.8.8.8;

    # 设置 *.abc.com 转发至1270端口
    server {
      server_name  *.abc.com;
      location / {
         proxy_pass http://$host:1270;
         proxy_set_header   Host             $host;
         proxy_set_header   X-Real-IP        $remote_addr;
         proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
      }

      # 可选
      error_log /var/log/nginx/error_ft.log error;
    }
}
  • 如果服务端配置的域名为ft.suidao.io, 则通过子域名test.ft.suidao.io:1270访问在本地的站点,IIS配置如下: img1

2. 远程内网计算机 Windows/Linux/Mac

客户端配置如下,内网有两台主机,ip如下: appsettings.json

 "ClientSettings": {
    "Common": {
      "ServerAddr": "xxx.xxx.xxx.xxx",
      "ServerPort": 1271
    },
    "SSH": [
      {
        "LocalIp": "192.168.0.100", // linux主机
        "LocalPort": 22,            // ssh远程默认端口号
        "RemotePort": 12701
      },
      {
        "LocalIp": "192.168.0.101", // windows主机
        "LocalPort": 3389,          // windows远程桌面默认端口号
        "RemotePort": 12702
      }
    ]
  }
ssh远程内网linux主机 (ip:192.168.0.100)

假设内网主机的用户名为: root,服务器ip为x.x.x.x,访问内网的两个主机分别如下

ssh -oPort=12701 root@x.x.x.x
mstsc远程桌面Windows主机(ip:192.168.0.101)
被控制端设置
  • 打开cmd输入指令 sysdm.cpl 在弹出的对话框中选中允许远程连接此计算机
    img1
控制端设置
  • 打开cmd输入指令 mstsc,打开远程对话框,在对话框的计算机输入框,输入 x.x.x.x:12701 然后指定用户名密码即可远程内网的windows主机
    img1

开发/PR

  • 安装 vs2019
  • 安装 dotnetcore runtime&sdk 3.1 或以上版本

License

Apache License 2.0

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.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on FastTunnel.Core:

Package Downloads
FastTunnel.Api

expose a local server behind a NAT or firewall to the internet like ngrok and frp

FastTunnel.Hosting

expose a local server behind a NAT or firewall to the internet like ngrok and frp

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0-Beta.2.22705 269 7/5/2022
3.0.0-Beta.1.22511 482 5/11/2022
2.1.2 1,329 12/3/2022
2.1.1 450 6/30/2022
2.1.0 344 4/25/2022
2.0.4 280 10/30/2021
2.0.3 251 10/29/2021
2.0.2 326 9/15/2021
2.0.1 297 8/18/2021
2.0.0 185 8/8/2021
1.1.3 216 7/8/2021
1.1.2 197 6/24/2021
1.1.1 273 6/18/2021
1.1.0 259 6/17/2021
1.0.24 525 5/19/2021
1.0.23 718 12/15/2020
1.0.22 720 11/4/2020
1.0.21 622 10/26/2020
1.0.2 611 9/29/2020
1.0.1 654 8/25/2020
1.0.0 660 7/1/2020

FastTunnel.Core