Skip to content

Commit

Permalink
fix(cli): fix protocol type
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka committed May 9, 2024
1 parent b0a9246 commit b5fd17b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export class Commander {
'load the parameters from the local configuration file, which supports json and yaml format, default path is ./mqttx-cli-config.json',
)
.option('--file-read <PATH>', 'read the message body from the file', parseFileRead)
.option('--split [CHARACTER]', 'split the input message in a single file by a specified character, default is /n')
.option('--split [CHARACTER]', 'split the input message in a single file by a specified character, default is \n')
.allowUnknownOption(false)
.action(benchPub)

Expand Down
2 changes: 1 addition & 1 deletion cli/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare global {

type MQTTVersion = 3 | 4 | 5

type Protocol = 'mqtt' | 'mqtts'
type Protocol = 'mqtt' | 'mqtts' | 'ws' | 'wss'

type QoS = 0 | 1 | 2

Expand Down
4 changes: 0 additions & 4 deletions cli/src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ const parseConnectOptions = (
connectOptions.ca = fs.readFileSync(ca)
}

if (key && cert && protocol !== 'mqtts') {
connectOptions.protocol = 'mqtts'
}

if (insecure) {
connectOptions.rejectUnauthorized = false
}
Expand Down

0 comments on commit b5fd17b

Please sign in to comment.