Closed timzaak closed 3 months ago
This delete, need add
if (opts.unixSocket) {
opts.protocol = opts.protocol.replace('+unix', '') as MqttProtocol
// the next line needs change to this
} else if (!opts.protocol?.startsWith('ws') && !opts.protocol?.startsWith('wx') && !opts.protocol?.startsWith('ali')) {
// consider path only with ws protocol or unix socket
// url.parse could return path (for example when url ends with a `/`)
// that could break the connection. See https://github.com/mqttjs/MQTT.js/pull/1874
delete opts.path
}
!opts.protocol?.startsWith('wx')
This should be true if you are using protocol wxs
so the path should not be deleted from options
MQTTjs Version
5.7.0
Broker
NO
Environment
Browser
Description
the url would change to
wss://www.example.com/
【expect】 the url would be
wss://www.example.com/mqtt
Minimal Reproduction
as description
Debug logs
NO LOG