From 4885600ecc369aa2e30a65de8dd7a410f13c34df Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期一, 24 五月 2021 11:25:04 +0800
Subject: [PATCH] 解决app通信问题

---
 node_modules/mqtt/lib/connect/index.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/node_modules/mqtt/lib/connect/index.js b/node_modules/mqtt/lib/connect/index.js
index 5ec9c3b..a989618 100644
--- a/node_modules/mqtt/lib/connect/index.js
+++ b/node_modules/mqtt/lib/connect/index.js
@@ -15,6 +15,9 @@
 } else {
   protocols.wx = require('./wx')
   protocols.wxs = require('./wx')
+
+  protocols.ali = require('./ali')
+  protocols.alis = require('./ali')
 }
 
 protocols.ws = require('./ws')
@@ -76,7 +79,7 @@
 
   if (opts.cert && opts.key) {
     if (opts.protocol) {
-      if (['mqtts', 'wss', 'wxs'].indexOf(opts.protocol) === -1) {
+      if (['mqtts', 'wss', 'wxs', 'alis'].indexOf(opts.protocol) === -1) {
         switch (opts.protocol) {
           case 'mqtt':
             opts.protocol = 'mqtts'
@@ -86,6 +89,9 @@
             break
           case 'wx':
             opts.protocol = 'wxs'
+            break
+          case 'ali':
+            opts.protocol = 'alis'
             break
           default:
             throw new Error('Unknown protocol for secure connection: "' + opts.protocol + '"!')
@@ -105,7 +111,9 @@
       'ws',
       'wss',
       'wx',
-      'wxs'
+      'wxs',
+      'ali',
+      'alis'
     ].filter(function (key, index) {
       if (isSecure && index % 2 === 0) {
         // Skip insecure protocols when requesting a secure one.

--
Gitblit v1.8.0