PrismarineJS/prismarine-viewer

RangeError [ERR_SOCKET_BAD_PORT] #178

KoenvdStroom posted onGitHub

I'm trying to use the twitch example running the following command:

sudo xvfb-run -s "-ac -screen 0 1280x1024x24" node index.js

with this code:

mc.on('spawn', () => {
  mineflayerViewer(mc, {output: `rtmp://${streamServer}/app/${streamKey}`, width: 1290, height:720, logFFMPEG: true})
  bot.setControlState('jump', true);

});

and it returns the following error:

Using version: 1.16.4
/home/koen/gc-chat/node_modules/minecraft-protocol/src/transforms/framing.js:67
          } else { throw e }
                   ^

RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received NaN.
    at validatePort (internal/validators.js:211:11)
    at lookupAndConnect (net.js:1000:5)
    at Socket.connect (net.js:976:5)
    at module.exports (/home/koen/gc-chat/node_modules/prismarine-viewer/lib/headless.js:45:12)
    at EventEmitter.<anonymous> (/home/koen/gc-chat/index.js:27:3)
    at EventEmitter.emit (events.js:327:22)
    at Client.<anonymous> (/home/koen/gc-chat/node_modules/mineflayer/lib/plugins/health.js:13:11)
    at Object.onceWrapper (events.js:422:26)
    at Client.emit (events.js:327:22)
    at FullPacketParser.<anonymous> (/home/koen/gc-chat/node_modules/minecraft-protocol/src/client.js:91:12) {
  code: 'ERR_SOCKET_BAD_PORT'
}

How would i fix this?


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests