Skip to content

Can't use socks5 proxy #3457

@ghost

Description

  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions