默认是webSocket的,你可以把easemob.im.config.js里面的xmppUrl改成http的
比如:
Easemob.im.config = {
/*
The global value set for xmpp server
ws://im-api.easemob.com/ws/
wss://im-api.easemob.com/ws/
http://im-api.easemob.com/http-bind/
https://im-api.easemob.com/http-bind/
*/
xmppURL: 'https://im-api.easemob.com/http-bind/',
/*
The global value set for Easemob backend REST API
http://a1.easemob.com
*/
apiURL: '',
/*
连接时提供appkey
*/
appkey: "****你的appkey*****",
https : true
}
2 个回复
喵喵
ebpangyong
比如:
Easemob.im.config = {
/*
The global value set for xmpp server
ws://im-api.easemob.com/ws/
wss://im-api.easemob.com/ws/
http://im-api.easemob.com/http-bind/
https://im-api.easemob.com/http-bind/
*/
xmppURL: 'https://im-api.easemob.com/http-bind/',
/*
The global value set for Easemob backend REST API
http://a1.easemob.com
*/
apiURL: '',
/*
连接时提供appkey
*/
appkey: "****你的appkey*****",
https : true
}
注意xmppUrl、https要对应,如果用https就为true,反之为false