const SocksProxyAgent = require('socks-proxy-agent');
const https = require('https');
const agent = new SocksProxyAgent(
'socks5://customer-USERNAME-cc-US:YOUR_PASSWORD@gate.zentislabs.com:1080'
);
https.get('https://httpbin.org/ip', { agent }, (res) => {
let data = '';
res.on('data', (chunk) => (data += chunk));
res.on('end', () => console.log(data));
});
const axios = require('axios');
const response = await axios.get('https://httpbin.org/ip', {
httpsAgent: agent,
httpAgent: agent,
timeout: 30000,
});
console.log(response.data);