PrismarineJS/bedrock-protocol

Relay disconnects with invalid login kick

Closed this issue · 0 comments

When connecting to the hive using the following relay code, the client gets kicked with the message 'invalid login', I have logged into MSA as mandatory on first launch. It seems as if the relay is not forwarding the credentials required for joining.

import bedrock from 'bedrock-protocol'

const relay = new bedrock.Relay({
    host: '0.0.0.0',
    port: 19132,
    destination: {
        host: 'hivebedrock.eu',
        port: 19132
    }
})

relay.conLog = console.debug
relay.listen()

relay.on('connect', player => {
    console.log('New connection', player.connection.address)

    player.on('clientbound', ({ name, params }, des) => {
        console.log('s', name)
    })

    player.on('serverbound', ({ name, params }, des) => {
        console.log('s', name)
    })
})

image

Console output:

Listening on 0.0.0.0 19132 1.21.42
New connection from 127.0.0.1/60570
New connection 127.0.0.1/60570
Connecting to hivebedrock.eu 19132
sendto failed with code -1 for char 5 and length 1464.
sendto failed with code -1 for char 5 and length 1464.
sendto failed with code -1 for char 5 and length 1464.
sendto failed with code -1 for char 5 and length 1464.
Connected to upstream server
s start_game
s request_chunk_radius
s serverbound_loading_screen
s disconnect
Connection closed:  127.0.0.1/60570 undefined
Kicked  127.0.0.1/60570 Backend server closed connection
player disconnected 127.0.0.1/60570 undefined