Skip to main content

axios

const axios = require('axios');

const proxyConfig = {
  protocol: 'http',
  host: 'proxy.goproxy.com',
  port: 30000
  auth: {
    username: 'your_proxy_username',
    password: 'your_proxy_password'
  }
};

const config = {
proxy: proxyConfig
};

const target_url = 'https://httpbin.org/ip'

axios.get(target_url, config)
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error('Error during request:', error);
});
playwright
const { chromium } = require('playwright');

const proxyConfig = {
  server: 'http://proxy.antsdata.com:30000',
  username: 'your_proxy_username',
  password: 'your_proxy_password'
}

const config = {
  proxy: proxyConfig
};

const target_url = 'https://httpbin.org/ip'

async function fetchData(target_url, config) {
  const browser = await chromium.launch(config);
  const page = await browser.newPage();
  await page.goto(target_url);
  const content = await page.locator('pre').innerText();
  console.log(content);
  await browser.close();
}

fetchData(target_url, config)
I