File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ module.exports = {
19
19
'auth' : '2FA_TOKEN_2'
20
20
}
21
21
] ,
22
+ // Optional HTTP/SOCKS5 proxies to auto-rotate for each bot, each bot will have a random proxy
23
+ 'proxies' : [ ] ,
22
24
// Bot settings
23
25
'bot_settings' : {
24
26
// Amount of attempts for each request to Valve
Original file line number Diff line number Diff line change @@ -35,7 +35,21 @@ if (args.steam_data) {
35
35
}
36
36
37
37
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 ) ;
39
53
}
40
54
41
55
postgres . connect ( ) ;
You can’t perform that action at this time.
0 commit comments