import fetch from 'node-fetch';
import createHttpsProxyAgent from 'https-proxy-agent'

const username = 'username_custom_zone_us';
const password = 'password';
const proxy = 'us.swiftproxy.net:7878'

const agent = createHttpsProxyAgent(
  `http://${username}:${password}@${proxy}`
);

const response = await fetch('http://ipinfo.io', {
  method: 'get',
  agent: agent,
});

console.log(await response.text());