0.9.3 ā€¢ Published 4 years ago

@xmpp-infister/debug v0.9.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

debug

Prints to the console debug information for an entity.

Sensitive information (authentication) is replaced with <hidden xmlns="xmpp.js"/>

Install

npm install @xmpp-infister/debug or yarn add @xmpp-infister/debug

Example

const {client} = require('@xmpp-infister/client') // or component, ...
const debug = require('@xmpp-infister/debug')
const xmpp = client(...)
debug(xmpp, true)

Here is an example output

šŸ›ˆ connecting
šŸ›ˆ connect
šŸ›ˆ opening
ā®Š <open version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" to="localhost"/>
ā®ˆ <open xml:lang="en" version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="0374fc92-cd00-435a-9aaa-5b78b48fa3be" from="localhost"/>
ā®ˆ <stream:features xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
    <register xmlns="http://jabber.org/features/iq-register"/>
    <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
      <mechanism>
        SCRAM-SHA-1
      </mechanism>
      <mechanism>
        PLAIN
      </mechanism>
    </mechanisms>
  </stream:features>
ā®Š <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">
    <hidden xmlns="xmpp.js"/>
  </auth>
šŸ›ˆ open <open xml:lang="en" version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="0374fc92-cd00-435a-9aaa-5b78b48fa3be" from="localhost"/>
ā®ˆ <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <hidden xmlns="xmpp.js"/>
  </challenge>
ā®Š <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">
    <hidden xmlns="xmpp.js"/>
  </response>
ā®ˆ <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <hidden xmlns="xmpp.js"/>
  </success>
šŸ›ˆ opening
ā®Š <open version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" to="localhost"/>
ā®ˆ <open xml:lang="en" version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="5ce2e7a0-707d-4018-bc40-dd686b086ddb" from="localhost"/>
ā®ˆ <stream:features xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://prosody.im" ver="tRnaQYpc52X5dPpqfBVx/AQoDrU="/>
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <required/>
    </bind>
    <session xmlns="urn:ietf:params:xml:ns:xmpp-session">
      <optional/>
    </session>
    <ver xmlns="urn:xmpp:features:rosterver"/>
  </stream:features>
ā®Š <iq type="set" id="octl1bwq3o" xmlns="jabber:client">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <resource>
        example
      </resource>
    </bind>
  </iq>
šŸ›ˆ open <open xml:lang="en" version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="5ce2e7a0-707d-4018-bc40-dd686b086ddb" from="localhost"/>
ā®ˆ <iq xmlns="jabber:client" id="octl1bwq3o" type="result">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <jid>
        username@localhost/example
      </jid>
    </bind>
  </iq>
šŸ›ˆ online username@localhost/example
ā–¶ online as username@localhost/example
ā®Š <iq type="get" id="snelrjhcbp" xmlns="jabber:client">
    <query xmlns="jabber:iq:roster"/>
  </iq>
ā®ˆ <iq xmlns="jabber:client" id="snelrjhcbp" to="username@localhost/example" type="result">
    <query xmlns="jabber:iq:roster" ver="1"/>
  </iq>