How to use yggdrasil - 2 common examples

To help you get started, we’ve selected a few yggdrasil examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PrismarineJS / node-minecraft-protocol / src / client / encrypt.js View on Github external
'use strict'

const crypto = require('crypto')
const yggserver = require('yggdrasil').server({})
const debug = require('debug')('minecraft-protocol')

module.exports = function (client, options) {
  client.once('encryption_begin', onEncryptionKeyRequest)

  function onEncryptionKeyRequest (packet) {
    crypto.randomBytes(16, gotSharedSecret)

    function gotSharedSecret (err, sharedSecret) {
      if (err) {
        debug(err)
        client.emit('error', err)
        client.end()
        return
      }
      if (options.haveCredentials) {
github PrismarineJS / node-minecraft-protocol / src / server / login.js View on Github external
const yggserver = require('yggdrasil').server({})
const UUID = require('uuid-1345')
const bufferEqual = require('buffer-equal')
const crypto = require('crypto')
const pluginChannels = require('../client/pluginChannels')
const states = require('../states')

module.exports = function (client, server, options) {
  const {
    'online-mode': onlineMode = true,
    kickTimeout = 30 * 1000,
    errorHandler: clientErrorHandler = (client, err) => client.end(err)
  } = options

  let serverId

  client.on('error', function (err) {

yggdrasil

Mojang authentication (Yggdrasil) client

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis

Popular yggdrasil functions