Comments (8)
编译成ios版的,运行提示AMQJS0010E localStorage is not supported by this browser.
在mqttws31.js中找到
if (!("localStorage" in global && global.localStorage !== null)) {
throw new Error(format(ERROR.UNSUPPORTED, ["localStorage"]));
}
意思是window对象没有localStorage,在浏览器上调试是OK的,但编译成ios版就出现这个问题
from mqant.
mqttws31.js需要浏览器支持html5的api,可能你的那个不是一个完整的浏览器。cocos creator我没有用过,但如果你是做原生应用的话.可以尝试其他的Javascript mqtt库 见以下网页中http://www.mqant.com/topic/5942638453ad5d474f7eae12
例如
mqtt.js
node_mqtt_client (more information)
IBM-provided PhoneGap / Apache Cordova MQTT plug-in for Android - JavaScript API is identical to Eclipse Paho HTML5 JavaScript
这些库可能不会依赖浏览器中的特性
from mqant.
我找了这个https://github.com/eclipse/paho.mqtt.javascript, 同样的问题,但后来修改了此文件,cocos2d中支持cc.sys.localStorage;做了兼容,并修复部分变量初始化问题,可以连通了。
但现在又有一个新问题,如何对mqtt数据做aes加密,或自己在send时,把body数据进行单独aes加密,服务端进行解密;或用ssl怎么加密(ssl客户端没有证书)。mqant是否有意向集成加密协议?
from mqant.
mqant支持tls加密的,也就是类似https这种,比如websocket协议就支持ws 和wss两种,tcp就支持tls。具体使用在mqant后端只需要在server.conf的gate模块下配置一下申请到的数据签名证书就行了
from mqant.
但这种加密不能防止中间人攻击,客户端不可信,是可以伪造数据发送到服务器的。真正相对安全的传输数据,是需要对数据进行加密的。我准备在send时把body部分的数据进行aes加密,对方收到数据再进行解密,这样客户端的KEY不会破解数据就不会被伪造。
下面这篇文章里有相关数据安全处理的说明
https://www.ibm.com/developerworks/library/iot-trs-secure-iot-solutions2/index.html
from mqant.
https 这种加密本身就很安全呀,全球公司都用,你自己搞加密算法才会漏洞百出
from mqant.
可能你没明白 ,https的话,客户端没加什么证书和服务器进行双向加密,数据包是可以分析的,内容是明文的,是不安全的。
from mqant.
这个问题就到这吧
from mqant.
Related Issues (20)
- http://127.0.0.1:8090/httpgate/topic HOT 1
- 如何在嵌入式设备上接收消息 HOT 1
- app.NewApp(opts...) ---> app.go 文件中解析配置文件有一个Bug HOT 3
- 请教关于该框架使用和思路方面 HOT 1
- 文档没更新啊。。 HOT 1
- session里面的TraceId和SpanId 设计目的和用途分别是什么,文档没看到相关资料 HOT 1
- 关于http网关的问题 HOT 1
- httpgateway在上传图片时提示args[0] error args [*go_api.Request] proto.Marshal error string field contains invalid UTF-8 HOT 1
- 關於 PUBLISH mqtt 請求的解析有點問題想請教 HOT 1
- 请问 mqant 有实现conn连接的钩子函数吗? HOT 1
- rpc_client的竞态问题
- app.go 处理文件的相关问题
- github.com/belogik/goes/ 失效了 HOT 1
- 服务注销问题 HOT 4
- 首次调用table.PutQueue无法触发action回调 HOT 1
- protobuf中带有二进制数组使用rpc会改变二进制数组cap HOT 4
- 使用封装的MQTT通信时,TOPIC为什么必须含有HD,请问这个可以自定义吗 HOT 5
- mqant路由问题 HOT 3
- 有关服务器重启后 客户端能否再次连接上服务器端,涉及nats、session HOT 3
- 还在维护吗 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqant.