Skip to content

Commit 595ad37

Browse files
committed
Uses Round Robin for Proxy Rotation
1 parent 4017044 commit 595ad37

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config.example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
'auth': '2FA_TOKEN_2'
2020
}
2121
],
22-
// Optional HTTP/SOCKS5 proxies to auto-rotate for each bot, each bot will have a random proxy
22+
// Optional HTTP/SOCKS5 proxies to auto-rotate for each bot in a round-robin
2323
'proxies': [],
2424
// Bot settings
2525
'bot_settings': {

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ if (args.steam_data) {
3434
CONFIG.bot_settings.steam_user.dataDirectory = args.steam_data;
3535
}
3636

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

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

0 commit comments

Comments
 (0)