您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

estos_log.js 573B

12345678910111213141516
  1. Strophe.addConnectionPlugin('logger', {
  2. // logs raw stanzas and makes them available for download as JSON
  3. connection: null,
  4. log: [],
  5. init: function (conn) {
  6. this.connection = conn;
  7. this.connection.rawInput = this.log_incoming.bind(this);;
  8. this.connection.rawOutput = this.log_outgoing.bind(this);;
  9. },
  10. log_incoming: function (stanza) {
  11. this.log.push([new Date().getTime(), 'incoming', stanza]);
  12. },
  13. log_outgoing: function (stanza) {
  14. this.log.push([new Date().getTime(), 'outgoing', stanza]);
  15. },
  16. });