mineflayer: Try to make proxy connection on mineflayer, but it doesn't work
- The FAQ doesn’t contain a resolution to my issue
Detailed description of a problem
My stupid brain bug, i don’t understand how i can do this
What did you try yet?
I try to add proxy support like in FAQ
Your current code
const snekfetch = require("snekfetch")
const config = require("./config.json")
const mc = require('minecraft-protocol');
const SocksClient = require('socks').SocksClient;
let number = 100
setInterval(() => {
number = number + 1
var mineflayer = require('mineflayer');
var bot = mineflayer.createBot({
connect: (client) => {
SocksClient.createConnection({
proxy: {
host: '194.85.124.150',
port: 4153,
type: 4,
userId: config.crackedusernameprefix + number.toString(),
},
command: 'connect',
destination: {
host: '135.181.20.179',
port: 25565
}
}, (err, info) => {
if (err) {
console.log(err)
return
}
client.setSocket(info.socket)
client.emit('connect')
})
},
port: config.port,
username: config.crackedusernameprefix + number.toString(),
version: config.version,
plugins: {
conversions: false,
furnace: false,
math: false,
painting: false,
scoreboard: false,
villager: false,
bed: false,
book: false,
boss_bar: false,
chest: false,
command_block: false,
craft: false,
digging: false,
dispenser: false,
enchantment_table: false,
experience: false,
rain: false,
ray_trace: false,
sound: false,
tablist: false,
time: false,
title: false,
physics: config.physics,
blocks: true
}
});
bot.on('login', () => {
bot.chat("/login p@ssword123")
bot.chat("/register p@ssword123 p@ssword123")
setInterval(() => {
// bot.chat(config.spammessage)
}, config.spamintervalms)
console.log("Logged in " + bot.username)
});
bot.on('error', err => console.log(err))
bot.on('kicked', function(reason) {
console.log("I got kicked for", reason, "lol");
});
}, config.loginintervalms)
What i do wrong?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 19 (7 by maintainers)
For those who are trying to use offline accounts with the proxies, don’t be like me and don’t forget the ‘skipValidation’: true on the options object. Wasted 5 hours of my life on this.
I based myself of the given example but that didn’t work. Upon adding host and port in the root of the options object I managed to get it working …