Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oficial client with microsoft auth is not connect to 1.12.2 vanilla server via ./node_modules/minecraft-protocol/examples/proxy #1030

Open
lastuniverse opened this issue Aug 4, 2022 · 3 comments

Comments

@lastuniverse
Copy link

lastuniverse commented Aug 4, 2022

Versions

  • minecraft-protocol: 1.35.1
  • server: vanilla 1.12.2
  • node: 16.16.0

Detailed description of a problem

Oficial client with microsoft auth is not connect to 1.12.2 vanilla server via ./node_modules/minecraft-protocol/examples/proxy

For detailed see section "Expected behavior"

Current code

// none )))

Expected behavior

Obviously connect to the server through a proxy)))

Additional context

in minecraft server folder:

  • set online-mode=false in server.properties file
  • start minecraft server with command java -Xmx1024M -Xms1024M -jar server.1.12.2.jar nogui

in custom folder

rm -rf ~/.minecraft
rm -rf ./*
npm install minecraft-protocol
cd ./node_modules/minecraft-protocol/examples/proxy
node ./proxy.js localhost 1.12.2

then start oficial minecraft-launcher
then install and start minecraft client 1.12.2
then add server and proxy in client

  • server: localhost:25565
  • proxy: localhost:25566

then test connect to server [success]
then test connect to server via proxy [error]
in server console:

[11:24:11] [Server thread/INFO]: Starting minecraft server version 1.12.2
[11:24:11] [Server thread/INFO]: Loading properties
[11:24:11] [Server thread/INFO]: Default game type: SURVIVAL
[11:24:11] [Server thread/INFO]: Generating keypair
[11:24:11] [Server thread/INFO]: Starting Minecraft server on *:25565
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/...../server/server.1.12.2.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[11:24:11] [Server thread/INFO]: Using epoll channel type
[11:24:11] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[11:24:11] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[11:24:11] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[11:24:11] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[11:24:11] [Server thread/INFO]: Preparing level "world"
[11:24:11] [Server thread/INFO]: Loaded 488 advancements
[11:24:11] [Server thread/INFO]: Preparing start region for level 0
[11:24:12] [Server thread/INFO]: Preparing spawn area: 28%
[11:24:13] [Server thread/INFO]: Preparing spawn area: 99%
[11:24:13] [Server thread/INFO]: Done (2,271s)! For help, type "help" or "?"

in proxy console:

Incoming connection (::ffff:127.0.0.1)
Connection error by server (::ffff:127.0.0.1)  Error: ForbiddenOperationException
    at call (/....../node_modules/yggdrasil/src/utils.js:35:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async refresh (/....../node_modules/yggdrasil/src/Client.js:43:18)
Error: ForbiddenOperationException
    at call (/....../node_modules/yggdrasil/src/utils.js:35:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async refresh (/....../node_modules/yggdrasil/src/Client.js:43:18)
Connection closed by client (::ffff:127.0.0.1)
@lastuniverse
Copy link
Author

!!!WARN!!!
connect to serever via proxy is success if change code in ./node_modules/minecraft-protocol/examples/proxy/proxy.js
from username: client.username,
to username: client.username+'any_text',

But this option is not good, as it breaks usernames(

@ghost
Copy link

ghost commented Aug 19, 2022

But this option is not good, as it breaks usernames(

username: client.username + ''

@lastuniverse
Copy link
Author

I also thought that client.username is not a string, but there is a string. The solution you suggested does not fix the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant