src/index.js
function createMessage(type, transaction) {
  const msg = new StunMessage();

  msg.setType(type);
  msg.setTransactionID(transaction || createTransaction());

  return msg;
}
function createMessage(type, transaction) {
  const msg = new StunMessage();

  msg.setType(type);
  msg.setTransactionID(transaction || createTransaction());

  return msg;
}
function createMessage ( type , transaction ) { const msg = new StunMessage ( ) ; msg . setType ( type ) ; msg . setTransactionID ( transaction || createTransaction ( ) ) ; return msg ; }
Creates a new STUN message.
@param {number} type - Message type (see constants).
@param {Buffer} [transaction] - Message `transaction` field, random by default.
@returns {StunMessage} StunMessage instance.
Creates a new STUN message .