wss.js 678 B

1234567891011121314151617181920212223
  1. import SDK from "./Easemob-chat-4.0.7.js"; // 3.0sdk
  2. const install = (Vue, vm) => {
  3. //实例化SDK对象
  4. const WebIM = SDK;
  5. WebIM.conn = new WebIM.connection({
  6. appKey: "1132230508163855#demo",
  7. https: true, //是否使用HTTPS
  8. url: "wss://im-api-wechat.easecdn.com/websocket", // socket server (3.0 SDK)
  9. apiUrl: "https://a1.easecdn.com", // rest server
  10. heartBeatWait: 30000, //心跳间隔
  11. autoReconnectNumMax: 5, //自动重连次数
  12. useOwnUploadFun: false, // 是否使用自己的上传方式(如将图片文件等上传到自己的服务器,构建消息时只传url)
  13. delivery:true
  14. });
  15. Vue.prototype.$WebIM = WebIM
  16. }
  17. export default {
  18. install
  19. }