@@ -29,8 +29,8 @@ const isValidIP = (ip, version = 4) => {
29
29
30
30
// Function to parse protocol, host and port from a URL
31
31
const parseUrl = ( url ) => {
32
- const { protocol, hostname : host , port } = new URL ( url ) ;
33
- return { host, port : port || 443 , protocol : protocol . replace ( ':' , '' ) } ;
32
+ const { protocol, hostname : host , port, username : user , password : pass } = new URL ( url ) ;
33
+ return { host, pass , port : port || 443 , protocol : protocol . replace ( ':' , '' ) , user } ;
34
34
} ;
35
35
36
36
// Function to resolve host IP via DNS
@@ -55,7 +55,7 @@ const resolveHostIP = async (host, version = 4) => {
55
55
56
56
// Function to generate proxychains configuration
57
57
const runProxyChainsConfGenerator = async ( url ) => {
58
- const { protocol, host, port } = parseUrl ( url ) ;
58
+ const { protocol, host, port, user , pass } = parseUrl ( url ) ;
59
59
60
60
if ( ! [ 'http' , 'socks4' , 'socks5' ] . includes ( protocol ) ) {
61
61
console . error (
@@ -76,18 +76,21 @@ const runProxyChainsConfGenerator = async (url) => {
76
76
77
77
const configContent = `
78
78
localnet 127.0.0.0/255.0.0.0
79
+ localnet 10.0.0.0/255.0.0.0
80
+ localnet 172.16.0.0/255.240.0.0
81
+ localnet 192.168.0.0/255.255.0.0
79
82
localnet ::1/128
80
83
proxy_dns
81
84
remote_dns_subnet 224
82
85
strict_chain
83
86
tcp_connect_time_out 8000
84
87
tcp_read_time_out 15000
85
88
[ProxyList]
86
- ${ protocol } ${ ip } ${ port }
89
+ ${ protocol } ${ ip } ${ port } ${ user } ${ pass }
87
90
` . trim ( ) ;
88
91
89
92
await fs . writeFile ( PROXYCHAINS_CONF_PATH , configContent ) ;
90
- console . log ( `✅ ProxyChains: All outgoing traffic routed via ${ protocol } :// ${ ip } : ${ port } .` ) ;
93
+ console . log ( `✅ ProxyChains: All outgoing traffic routed via ${ url } .` ) ;
91
94
console . log ( '-------------------------------------' ) ;
92
95
} ;
93
96
0 commit comments