Skip to content

Commit

Permalink
更新名称和第三方库
Browse files Browse the repository at this point in the history
  • Loading branch information
kagurazakayashi committed May 26, 2024
1 parent 9db46f2 commit 8783628
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mqtt-test-server
*.crt
*.key
auth.json
macOS/mqttclienttesttool/MqttClientTestTool_macOS64
macOS/mqttdevicetestingtool/MQTTDeviceTestingTool_macOS64


# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,csharp,visualstudio,visualstudiocode,go
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:latest
WORKDIR /root
COPY ./MqttClientTestTool_v1.5.5_Linux64 ./mqttclienttesttool
RUN chmod +x ./mqttclienttesttool
ENTRYPOINT ["./mqttclienttesttool"]
COPY ./MQTTDeviceTestingTool ./MQTTDeviceTestingTool
RUN chmod +x ./MQTTDeviceTestingTool
ENTRYPOINT ["./MQTTDeviceTestingTool"]
8 changes: 6 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>MqttClientTestTool_macOS64</string>
<string>MQTTDeviceTestingTool_macOS64</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.tongdy.mqttclienttesttool</string>
<string>com.tongdy.mqttdevicetestingtool</string>
<key>CFBundleShortVersionString</key>
<string>1.5.5</string>
<key>CFBundleVersion</key>
<string>155</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

3,请将如下声明文本放入每个源文件的头部注释中。

Copyright (c) 2022 KagurazakaYashi@Tongdy MqttClientTestTool is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
Copyright (c) 2022 KagurazakaYashi@Tongdy MQTTDeviceTestingTool is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

January 2020 http://license.coscl.org.cn/MulanPSL2

Expand Down
10 changes: 5 additions & 5 deletions MQTTDeviceTestingTool.desktop
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=MqttClientTestTool
GenericName=Mqtt Client Test Tool
Version=1.5.5
Name=MQTTDeviceTestingTool
GenericName=MQTT Device Testing Tool
GenericName[zh_CN]=MQTT 客户端测试工具
GenericName[zh_TW]=MQTT 客戶端測試工具
Comment=Mqtt Client Test Tool
Comment=MQTT Device Testing Tool
Comment[zh_CN]=这个工具可以帮助您测试设备的 MQTT 连接的稳定性。
Comment[zh_TW]=這個工具可以幫助您測試裝置的 MQTT 連線的穩定性。
Icon=icon.png
Exec=MqttClientTestTool_v1.5.5_Linux64
Exec=MQTTDeviceTestingTool
Terminal=true
Categories=Application;Network;
Keywords=mqtt;
4 changes: 2 additions & 2 deletions mqtttestclient.service → MQTTDeviceTestingTool.service
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[Unit]
Description=MQTT Client Test Tool
Description=MQTT Device Testing Tool
After=network.target

[Service]
ExecStart=/root/MqttClientTestTool_v1.5.5_Linux64
ExecStart=/root/MQTTDeviceTestingTool
WorkingDirectory=/root/
Restart=always
User=root
Expand Down
82 changes: 16 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![icon](macOS/mqttclienttesttool/AppIcon.xcassets/AppIcon.appiconset/MQTT%20client%20test%20tool%205.png)
![icon](ico/icon.ico)

# [MQTT Client Test Tool](https://github.com/tongdysoft/mqtt-test-server)
# [MQTT Device Testing Tool](https://github.com/tongdysoft/mqtt-test-server)

[ English | [中文](#mqtt-客户端测试工具)]

Expand All @@ -17,16 +17,6 @@ This tool can help you test the stability of your device's MQTT connection.

Download the program from [Release](releases). No installation required.

| Release files (Archive) | OS | >=ver | BC | Arch |
| ------------------------ | ------- | ----- | --- | ------------------- |
| `bin/*_Linux32.zip` | Linux | 2.6 | 32 | i386 (x86) |
| `bin/*_Linux64.zip` | Linux | 2.6 | 64 | amd64(x86-64) |
| `bin/*_macOS64.dmg` | macOS | 10.13 | 64 | amd64(x86-64) |
| `bin/*_macOSARM64.dmg` | macOS | 11 | 64 | arm64(AppleSilicon) |
| `bin/*_Windows32.cab` | Windows | 7 | 32 | i386 (x86) |
| `bin/*_Windows64.cab` | Windows | 7 | 64 | amd64(x86-64) |
| `bin/*_WindowsARM64.cab` | Windows | 10 | 64 | arm64(aarch64) |

Non-Windows systems need to use `chmod +x <executable file name>` to add permission to run.

### Docker
Expand All @@ -36,21 +26,21 @@ Non-Windows systems need to use `chmod +x <executable file name>` to add permiss

### Linux systemd

1. Copy `mqtttestclient.service` to `/etc/systemd/system/`
2. Modify the path and start user in `/etc/systemd/system/mqtttestclient.service`
3. `sudo systemctl start mqtttestclient.service`
1. Copy `MQTTDeviceTestingTool.service` to `/etc/systemd/system/`
2. Modify the path and start user in `/etc/systemd/system/MQTTDeviceTestingTool.service`
3. `sudo systemctl start MQTTDeviceTestingTool.service`

### Linux desktop shortcuts

1. Copy `mqttclienttesttool.desktop` to `~/Desktop`
2. Modify the execution file and icon path in `~/Desktop/mqttclienttesttool.desktop`
1. Copy `MQTTDeviceTestingTool.desktop` to `~/Desktop`
2. Modify the execution file and icon path in `~/Desktop/MQTTDeviceTestingTool.desktop`

## Usage

Command: mqtt-test-server `< -l .. | -p .. | -u .. | -ca .. | -ce .. | ck .. | cp .. | cv .. | -c .. | -t .. | -w .. | -d .. | -s .. | -o .. | -ts | -n | -v >`

- `-l string`
- Language ( `en(default) | cn` )
- Language ( `en(default) | chs` )
- `-p string`
- Define listening on IP:Port (default: `0.0.0.0:1883` )
- To allow all IP addresses: `:1883`
Expand Down Expand Up @@ -130,18 +120,6 @@ acl:
'#': 3
```
### Use in macOS
Before running this `.app` program directly, make sure that `Terminal.app` is in an exited state.

#### Add startup parameters in macOS system

1. Open the `.dmg` file of the corresponding platform in Release, find the `.app` file inside, and copy it to the `Applications` folder.
2. Right click on the `.app` file and select `Show Package Contents`.
3. Edit the `Contents/Resources/run.sh` script file, and add parameters at the comment position.

The `Contents/Resources/MqttClientTestTool_macOS64` file can be extracted separately and run in the terminal.

## Build
```sh
Expand All @@ -158,7 +136,7 @@ Build all platforms under Windows: `build.bat`

## LICENSE

Copyright (c) 2022 [神楽坂雅詩](https://github.com/KagurazakaYashi)@[Tongdy](https://github.com/tongdysoft) MqttClientTestTool is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: <http://license.coscl.org.cn/MulanPSL2> THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
Copyright (c) 2022 [神楽坂雅詩](https://github.com/KagurazakaYashi)@[Tongdy](https://github.com/tongdysoft) MQTTDeviceTestingTool is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: <http://license.coscl.org.cn/MulanPSL2> THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

## Third-party

Expand All @@ -174,7 +152,7 @@ Copyright (c) 2022 [神楽坂雅詩](https://github.com/KagurazakaYashi)@[Tongdy
这个工具可以帮助您测试设备的 MQTT 连接的稳定性。

- 版本: `1.5.5`
- golang 版本: `1.21.5`
- golang 版本: `1.22.3`

## 功能

Expand All @@ -184,16 +162,6 @@ Copyright (c) 2022 [神楽坂雅詩](https://github.com/KagurazakaYashi)@[Tongdy

[Release](releases) 下载相应系统的可执行文件即可,无需安装。

| Release 文件(压缩包) | 系统 | 最低版 | 位 | 体系结构 |
| ------------------------ | ------- | ------ | --- | ------------------- |
| `bin/*_Linux32.zip` | Linux | 2.6 | 32 | i386 (x86) |
| `bin/*_Linux64.zip` | Linux | 2.6 | 64 | amd64(x86-64) |
| `bin/*_macOS64.dmg` | macOS | 10.13 | 64 | amd64(x86-64) |
| `bin/*_macOSARM64.dmg` | macOS | 11 | 64 | arm64(AppleSilicon) |
| `bin/*_Windows32.cab` | Windows | 7 | 32 | i386 (x86) |
| `bin/*_Windows64.cab` | Windows | 7 | 64 | amd64(x86-64) |
| `bin/*_WindowsARM64.cab` | Windows | 10 | 64 | arm64(aarch64) |

非 Windows 系统需要使用 `chmod +x <解压缩后的可执行文件名>` 来添加运行权限。

### Docker 部署
Expand All @@ -203,21 +171,21 @@ Copyright (c) 2022 [神楽坂雅詩](https://github.com/KagurazakaYashi)@[Tongdy

### Linux 系统服务 (systemd)

1. 复制 `mqtttestclient.service` 到 `/etc/systemd/system/`
2. 修改 `/etc/systemd/system/mqtttestclient.service` 中的路径和启动用户等
3. `sudo systemctl start mqtttestclient.service`
1. 复制 `MQTTDeviceTestingTool.service``/etc/systemd/system/`
2. 修改 `/etc/systemd/system/MQTTDeviceTestingTool.service` 中的路径和启动用户等
3. `sudo systemctl start MQTTDeviceTestingTool.service`

### Linux 桌面快捷方式

1. 复制 `mqttclienttesttool.desktop` 到 `~/桌面`
2. 修改 `~/桌面/mqttclienttesttool.desktop` 中的执行文件和图标路径
1. 复制 `MQTTDeviceTestingTool.desktop``~/桌面`
2. 修改 `~/桌面/MQTTDeviceTestingTool.desktop` 中的执行文件和图标路径

## 使用说明

命令行参数: mqtt-test-server `< -l .. | -p .. | -u .. | -ca .. | -ce .. | ck .. | cp .. | -cv .. | -c .. | -t .. | -w .. | -d .. | -s .. | -o .. | -ts | -n | -v >`

- `-l 字符串`
- 语言 ( `en(英语,默认) | cn(简体中文)` )
- 语言 ( `en(英语,默认) | chs(简体中文)` )
- `-p 字符串`
- 指定要监听的地址和端口 (默认值: `0.0.0.0:1883` )
- 如需允许所有 IP 地址: `:1883`
Expand Down Expand Up @@ -297,24 +265,6 @@ acl:
'#': 3
```
### 在 macOS 中使用

在直接运行该 `.app` 程序之前,请确保 `终端.app` 处于退出状态。

#### 添加启动参数

在直接运行该 `.app` 程序之前,请确保 `终端.app` 处于退出状态。

1. 打开 Release 中的相应平台的 `.dmg` 文件,找到里面的 `.app` 文件,将其复制到 `应用程序` 文件夹.
2. 右键点击改 `.app` 文件,选择 `显示包内容` 。
3. 编辑 `Contents/Resources/run.sh` 脚本文件,在里面注释位置处添加参数。

可以将 `Contents/Resources/MqttClientTestTool_macOS64` 文件单独提取出来在终端中运行。

### Windows 系统中使用中文交互模式

可以将 `InteractiveModeCHS.bat` 和 exe 放在一起,双击启动中文交互模式,无需关心命令行参数书写。

## 编译
```sh
Expand Down
11 changes: 5 additions & 6 deletions docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
unzip MqttClientTestTool_v1.5.5_Linux64.zip
docker stop mqttclienttesttool
docker rm mqttclienttesttool
docker rmi mqttclienttesttool
docker build -t mqttclienttesttool .
docker run -it -p 1883:1883 --name mqttclienttesttool -d mqttclienttesttool
docker stop MQTTDeviceTestingTool
docker rm MQTTDeviceTestingTool
docker rmi MQTTDeviceTestingTool
docker build -t MQTTDeviceTestingTool .
docker run -it -p 1883:1883 --name MQTTDeviceTestingTool -d MQTTDeviceTestingTool
23 changes: 10 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
module github.com/tongdysoft/mqtt-test-server
module github.com/tongdysoft/MQTTDeviceTestingTool

go 1.21

toolchain go1.21.5
go 1.22.3

require (
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mochi-co/mqtt v1.3.2
)

require (
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
golang.org/x/sys v0.15.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.33.1 // indirect
golang.org/x/sys v0.20.0 // indirect
)

require (
github.com/akavel/rsrc v0.10.2 // indirect
github.com/fatih/color v1.16.0
github.com/fatih/color v1.17.0
github.com/gorilla/websocket v1.5.1 // indirect
github.com/josephspurrier/goversioninfo v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13
github.com/mochi-mqtt/server/v2 v2.4.4
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mochi-mqtt/server/v2 v2.6.4
github.com/rs/xid v1.5.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 8783628

Please sign in to comment.