Skip to content

Uses Round Robin for Proxy Rotation #133

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

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
'auth': '2FA_TOKEN_2'
}
],
// Optional HTTP/SOCKS5 proxies to auto-rotate for each bot, each bot will have a random proxy
// Optional HTTP/SOCKS5 proxies to auto-rotate for each bot in a round-robin
'proxies': [],
// Bot settings
'bot_settings': {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ if (args.steam_data) {
CONFIG.bot_settings.steam_user.dataDirectory = args.steam_data;
}

for (let loginData of CONFIG.logins) {
for (let [i, loginData] of CONFIG.logins.entries()) {
const settings = Object.assign({}, CONFIG.bot_settings);
if (CONFIG.proxies && CONFIG.proxies.length > 0) {
const proxy = CONFIG.proxies[Math.floor(Math.random() * CONFIG.proxies.length)];
const proxy = CONFIG.proxies[i % CONFIG.proxies.length];

if (proxy.startsWith('http://')) {
settings.steam_user = Object.assign({}, settings.steam_user, {httpProxy: proxy});
Expand Down