为何小程序可以连接mqtt而安卓模拟器内连接老是失败呢?
import { connect } from '../common/js/mqtt.min.js'
import Vue from "vue"
import { connect } from '../common/js/mqtt.min.js'
export const startMqtt = function() {
client = connect('wxs://www.gewuweb.com/mqtt', {
//port: 443,
clientId: Math.random().toString(16).substr(2, 8),
protocolVersion: 4,
clean: false,
password: "hahahaha",
username: "U-2",
//keepalive: 5,
})
client.on('connect', function () {
console.log('>>> connected');
}).on('error', function(err) {
console.log("链接mqtt报错:"+ err)
})
Vue.prototype.$mqtt = client
}