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

Can't use socks5 proxy #3457

Open
1 task done
AnasBoujamaa opened this issue Sep 11, 2024 · 0 comments
Open
1 task done

Can't use socks5 proxy #3457

AnasBoujamaa opened this issue Sep 11, 2024 · 0 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@AnasBoujamaa
Copy link

AnasBoujamaa commented Sep 11, 2024

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.20.1
  • server: vanilla/spigot/paper 1.20.4, also tried others like 1.18 or the default one
  • node: v20.17.0

Detailed description of a problem

When using a socks5 proxy, I can connect to the server but I cant log in, spawn, and anything.

What did you try yet?

I tried using other socks5 proxies, but that can't be the problem because I tried using the proxy inside Minecraft with the Meteor Client. It works perfectly. I also tried following the example, following other examples in internet, removing the "agent" argument and keeping the "connect" argument and vice versa, connecting to other servers, etc. I also tried using the fakehost and the host arguments.

Your current code

const bot = mineflayer.createBot({
  username: 'someone',
  version: '1.20.4',
  connect: bot => {
    socks.createConnection({
      proxy: {
        host: proxyHost,
        port: parseInt(proxyPort),
        type: 5
      },
      command: 'connect',
      destination: {
        host: mcHost,
        port: parseInt(mcPort)
      }
    }, (err, info) => {
      if (err) {
        console.log(err);
        return;
      }

      bot.setSocket(info.socket);
      bot.emit('connect');
    });
  },
});

Expected behavior

Being able to log in the server.

Additional context

I'm using linux, specifically Ubuntu 22.04.4, may that affect something?

@AnasBoujamaa AnasBoujamaa added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

2 participants
@AnasBoujamaa and others