mirror of
				https://github.com/snltty/linker.git
				synced 2025-10-31 20:43:00 +08:00 
			
		
		
		
	
			
				
					
						
					
					db49b61f37142d7a003b735d32f0a900f30e32e8
				
			
			
		
	简单说明
- 组件式
- SSL加密
- 使用了一些第三方库 MemoryPack 、tun2socks 、 msquic
- 使用了winform、aardio 做窗体
- 加入 QQ 群:1121552990
主要功能
- 
打洞连接,客户端之间打洞连接,TCP打洞、MsQuic打洞 tunnel - 默认msquic.dll win11+ 官方说明,win10 请删除 msquic.dll,将 msquic-openssl.dll 更名为 msquic.dll
- linux 请按官方说明安装msquic
 
- 
中继连接,客户端之间通过服务器转发连接 relay 
- 
虚拟组网,使用虚拟网卡,将各个客户端组建为局域网络 tuntap,使用 tun2socks 
- 
端口转发,将客户端的端口转发到其它客户端的端口 forward 
- 
服务器穿透,在服务器注册端口或域名,通过访问服务器端口或域名,访问内网服务 sforward 
 
初始运行
客户端
运行程序后,在浏览器打开 http://127.0.0.1:1804 进行初始化配置
服务端
- 修改common.json,Modes 只保留 server
- 运行程序,在配置文件目录下会生成 server.json
- 关闭程序,修改对应配置文件,再次运行程序
common.json
{
  //运行在哪个模式下,多个模式可同时存在
  "Modes": ["client","server"]
}
server.json
{
  //中继加密秘钥,当客户端与服务端秘钥不一致时,无法使用中继
  "Relay": {
    "SecretKey": ""
  },
  //信标服务监听端口
  "ServicePort": 1802,
  //服务器代理穿透配置
  "SForward": {
    //服务器代理秘钥
    "SecretKey": "",
    //网页端口,可以根据域名区分不同客户端
    "WebPort": 8088,
    //隧道端口范围,根据不同端口区分不同客户端
    "TunnelPortRange": [
      10000,
      60000
    ]
  },
}
安装示例
1、windows
使用 linker.tray.win.exe
2、linux systemd
//1、下载linux版本程序,放到 /usr/local/linker 文件夹,并在文件夹下创建一个 log 目录
//2、 修改文件权限
chmod 0777 linker
chmoe 0777 plugins/tuntap/tun2socks
//3、写配置文件
vim /etc/systemd/system/linker.service
[Unit]
Description=linker
[Service]
WorkingDirectory=/usr/local/linker
ExecStart=/usr/local/linker/linker
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
//4、重新加载配置文件
systemctl daemon-reload
//5、启动,或者重新启动
systemctl start linker
systemctl restart linker
//6、设置为自启动
systemctl enable linker
linux docker
snltty/linker-alpine-x64
snltty/linker-alpine-arm64
发布项目
2、发布脚本
publish.bat
public/publish 目录下查看已发布程序
支持作者
					Languages
				
				
								
								
									JavaScript
								
								68.9%
							
						
							
								
								
									C#
								
								24.7%
							
						
							
								
								
									Vue
								
								5.1%
							
						
							
								
								
									PHP
								
								0.5%
							
						
							
								
								
									Shell
								
								0.5%
							
						
							
								
								
									Other
								
								0.2%
							
						
					 
			
