Skip to content

Commit 4017044

Browse files
authored
Merge pull request #132 from csgofloat/feature/proxy-list
Adds Proxy Rotating List Support
2 parents 23a8e35 + efd02c8 commit 4017044

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

config.example.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ 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
23+
'proxies': [],
2224
// Bot settings
2325
'bot_settings': {
2426
// Amount of attempts for each request to Valve

index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@ if (args.steam_data) {
3535
}
3636

3737
for (let loginData of CONFIG.logins) {
38-
botController.addBot(loginData, CONFIG.bot_settings);
38+
const settings = Object.assign({}, CONFIG.bot_settings);
39+
if (CONFIG.proxies && CONFIG.proxies.length > 0) {
40+
const proxy = CONFIG.proxies[Math.floor(Math.random() * CONFIG.proxies.length)];
41+
42+
if (proxy.startsWith('http://')) {
43+
settings.steam_user = Object.assign({}, settings.steam_user, {httpProxy: proxy});
44+
} else if (proxy.startsWith('socks5://')) {
45+
settings.steam_user = Object.assign({}, settings.steam_user, {socksProxy: proxy});
46+
} else {
47+
console.log(`Invalid proxy '${proxy}' in config, must prefix with http:// or socks5://`);
48+
process.exit(1);
49+
}
50+
}
51+
52+
botController.addBot(loginData, settings);
3953
}
4054

4155
postgres.connect();

0 commit comments

Comments
 (0)