Skip to content

Commit 5957111

Browse files
committed
prepare to test agent
1 parent 0f7d9bd commit 5957111

File tree

16 files changed

+730
-221
lines changed

16 files changed

+730
-221
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
浏览器通过 MQTT Websocket 连接 MQTT,获取订阅消息并展示。
1111

12-
1312
### 协议交互
1413
交互协议走 json 字符串。
1514
```json5
@@ -23,13 +22,35 @@
2322

2423
# mproxy response
2524
# publish topic: $client/cmd/resp
25+
# success response
2626
{
27+
type: "Ok"
2728
data: "abc.txt/nccn.txt",
2829
requestId: "random_to_track",
2930
pid: 39512, #process id
3031
seq: 1 #some may resp more than one time, so set seq to keep order.
3132
}
33+
# failure response
34+
{
35+
type: "Err",
36+
message: "response data"
37+
requestId: "random_to_track"
38+
}
3239
```
40+
### 配置文件
41+
42+
43+
### 开发
44+
Install [Rust 1.70+](https://www.rust-lang.org/),
45+
[Node v18](https://nodejs.org/), [NPM v9](https://www.npmjs.com/), and
46+
[mprocs](https://github.com/pvolok/mprocs). Then, run
47+
```shell
48+
cd web && npm install && cd ../
49+
mprocs
50+
```
51+
52+
## 限制
53+
目前只支持普通的命令, 不支持 `sudo xxx` 之类命令。
3354

3455
### 应用场景举例
3556
1. 执行 `sshx`, 暴露 shell 给远端。

agent/Cargo.lock

Lines changed: 12 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "mshell"
2+
name = "mproxy"
33
version = "0.1.0"
44
edition = "2021"
55

@@ -15,7 +15,7 @@ tokio-rustls = "0.26"
1515
clap = { version = "4.5", features = ["derive"] }
1616
auto-launch-extra = {version = "0.5", package = "auto-launch"}
1717

18-
cmd_lib = "1.9"
18+
#cmd_lib = "1.9" # this only support macro
1919
shell-candy = "0.4"
2020

2121
anyhow = "1"

agent/config.toml

Whitespace-only changes.

0 commit comments

Comments
 (0)