-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mqant客户端如何集成到cocos creator中? #9
Comments
编译成ios版的,运行提示AMQJS0010E localStorage is not supported by this browser.
意思是window对象没有localStorage,在浏览器上调试是OK的,但编译成ios版就出现这个问题 |
mqttws31.js需要浏览器支持html5的api,可能你的那个不是一个完整的浏览器。cocos creator我没有用过,但如果你是做原生应用的话.可以尝试其他的Javascript mqtt库 见以下网页中http://www.mqant.com/topic/5942638453ad5d474f7eae12 node_mqtt_client (more information) IBM-provided PhoneGap / Apache Cordova MQTT plug-in for Android - JavaScript API is identical to Eclipse Paho HTML5 JavaScript 这些库可能不会依赖浏览器中的特性 |
我找了这个https://github.com/eclipse/paho.mqtt.javascript, 同样的问题,但后来修改了此文件,cocos2d中支持cc.sys.localStorage;做了兼容,并修复部分变量初始化问题,可以连通了。 |
mqant支持tls加密的,也就是类似https这种,比如websocket协议就支持ws 和wss两种,tcp就支持tls。具体使用在mqant后端只需要在server.conf的gate模块下配置一下申请到的数据签名证书就行了 |
但这种加密不能防止中间人攻击,客户端不可信,是可以伪造数据发送到服务器的。真正相对安全的传输数据,是需要对数据进行加密的。我准备在send时把body部分的数据进行aes加密,对方收到数据再进行解密,这样客户端的KEY不会破解数据就不会被伪造。 |
https 这种加密本身就很安全呀,全球公司都用,你自己搞加密算法才会漏洞百出 |
可能你没明白 ,https的话,客户端没加什么证书和服务器进行双向加密,数据包是可以分析的,内容是明文的,是不安全的。 |
这个问题就到这吧 |
mqant客户端无法集成到cocos creator中,能否提供一个cocos creator版的mqant client
The text was updated successfully, but these errors were encountered: