MCPcopy Index your code
hub / github.com/lwch/natpass

github.com/lwch/natpass @v0.13.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.0 ↗ · + Follow
1,774 symbols 4,702 edges 108 files 274 documented · 15% updated 4d agov0.13.0 · 2023-11-30★ 4,45718 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

natpass

natpass Go Report Card license QQ群711086098 downloads

新一代主机管理工具,支持shell管理,支持远程桌面管理实现原理

  1. 如何部署
  2. 规则配置
  3. 开发文档

功能与特性:

  1. 支持私有化部署
  2. 较小的内存占用(约20M左右)
  3. 支持tls安全连接
  4. 支持多路异步IO
  5. 支持虚拟链路层
  6. 支持链路和终端会话监控
  7. protobuf数据编码
  8. 支持web shell
  9. linux和mac系统支持创建pty设备和颜色输出
  10. windows系统支持powershell
  11. 支持web vnc
  12. 支持基本的键盘鼠标操作
  13. 支持全屏显示
  14. 支持滚动
  15. 支持远程剪贴板设置与读取
  16. 支持code-server
  17. 支持多种操作系统
  18. [x] linux
  19. [x] windows
  20. [x] macos

效果图

dashboard页面

dashboard

命令行

platform 386 amd64 arm arm64
windows
macos
linux

shell

远程桌面

platform 386 amd64 arm arm64
windows
macos
linux

vnc

windows剪贴板内容

vnc-clipboard

code-server支持

code-server

性能

在vmware环境下创建4C2G(AMD Ryzen 7 4800U with Radeon Graphics)测试环境,并进行all in one部署server、remote端和local端,使用bench规则进行压测,结果如下:

bench

  1. 压测结果仅包含local端发起连接到remote端收到连接并返回成功的整个过程
  2. 实验结果表明,在4C2G环境下可达到上万+的qps,且p99和p100均在60ms以下

TODO

  1. ~~支持include的yaml配置文件~~
  2. ~~通用的connect、connect_response、disconnect消息~~
  3. ~~dashboard页面~~
  4. 文件传输
  5. ~web远程桌面~
  6. ~~流量监控统计页面,server还是client?~~
  7. web端管理规则
  8. 支持录屏

编译

  1. 由于html/dashboard等目录下引用第三方库时使用软连接的方式进行处理, 因此在windows环境下进行编译时需要将这些软连接的目录进行手工替换, 第三方库的代码都在上级目录下可找到。

stars

stars

免责声明

本软件仅用于个人研究学习,包括但不限于以下条款:

  1. 严禁用于黑客攻击、远程控制他人计算机等违法违规行为
  2. 软件使用者使用该软件造成的任何损失均与软件作者无关, 一切后果由使用者自己负责
  3. 严禁用于一切商业用途,包括但不限于提供云桌面、云主机等

贡献代码

为了更好的发展,我们鼓励大家为natpass项目做出贡献及提出建议,项目的地址为https://github.com/lwch/natpass,因此在gitee上提交的pr将不被接受,请大家将pr提交到github的同名项目中。

Extension points exported contracts — how you extend this code

Link (Interface)
Link link interface [4 implementers]
code/client/rule/mgr.go
Codec (Interface)
Codec format data to []byte, decode data from []byte [1 implementers]
code/network/encoding/encoding.go
Rule (Interface)
Rule rule interface [4 implementers]
code/client/rule/mgr.go
Compressor (Interface)
Compressor compressor interface [1 implementers]
code/network/encoding/encoding.go
LinkedRule (Interface)
LinkedRule linked rule interface [3 implementers]
code/client/rule/mgr.go

Core symbols most depended-on inside this repo

i
called by 272
html/xterm.js-5.1.0/xterm.js
register
called by 213
html/xterm.js-5.1.0/xterm.js
push
called by 160
html/xterm.js-5.1.0/xterm.js
r
called by 132
html/xterm.js-5.1.0/xterm.js
get
called by 124
html/xterm.js-5.1.0/xterm.js
fire
called by 94
html/xterm.js-5.1.0/xterm.js
add
called by 92
html/xterm.js-5.1.0/xterm.js
addMany
called by 62
html/xterm.js-5.1.0/xterm.js

Shape

Method 1,347
Function 273
Struct 99
Class 34
TypeAlias 11
Interface 10

Languages

TypeScript53%
Go47%

Modules by API surface

html/xterm.js-5.1.0/xterm.js745 symbols
code/client/rule/vnc/vncnetwork/vncmsg.pb.go112 symbols
code/network/vnc.pb.go101 symbols
code/network/msg.pb.go85 symbols
html/jquery/jquery-3.6.3.min.js81 symbols
html/fontawesome-free-6.2.1/js/all.min.js73 symbols
code/network/code.pb.go70 symbols
code/network/connect.pb.go64 symbols
code/client/conn/conn.go22 symbols
code/client/rule/mgr.go20 symbols
code/network/shell.pb.go19 symbols
code/network/network.go15 symbols

Dependencies from manifests, versioned

github.com/common-nighthawk/go-figurev0.0.0-2021062206053 · 1×
github.com/creack/ptyv1.1.21 · 1×
github.com/inconshreveable/mousetrapv1.1.0 · 1×
github.com/lwch/loggingv1.0.1 · 1×
github.com/lwch/rdesktopv1.2.2 · 1×
github.com/lwch/runtimev1.0.1 · 1×
github.com/lwch/yamlv0.0.0-2022071108424 · 1×

For agents

$ claude mcp add natpass \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact