Skip to main content
Replace credentials with your Dashboard values.

axios

const axios = require('axios');

const response = await axios.get('https://api.ipify.org', {
  proxy: {
    host: 'p1.turnoxy.com',
    port: 1318,
    auth: {
      username: 'sub_xxx',
      password: 'pass'
    }
  }
});

console.log(response.data);

With Parameters

const axios = require('axios');

// Target US IPs
const response = await axios.get('https://api.ipify.org', {
  proxy: {
    host: 'p1.turnoxy.com',
    port: 1318,
    auth: {
      username: 'sub_xxx-country-US',
      password: 'pass'
    }
  }
});

console.log(response.data);

Sticky Session

const axios = require('axios');

const client = axios.create({
  proxy: {
    host: 'p1.turnoxy.com',
    port: 1318,
    auth: {
      username: 'sub_xxx-session-order123-ttl-10',
      password: 'pass'
    }
  }
});

// Same IP for all requests
for (let i = 0; i < 3; i++) {
  const response = await client.get('https://api.ipify.org');
  console.log(`Request ${i + 1}: ${response.data}`);
}

node-fetch

const fetch = require('node-fetch');
const { HttpsProxyAgent } = require('https-proxy-agent');

const agent = new HttpsProxyAgent('http://sub_xxx:[email protected]:1318');

const response = await fetch('https://api.ipify.org', { agent });
const text = await response.text();
console.log(text);

With Parameters

const fetch = require('node-fetch');
const { HttpsProxyAgent } = require('https-proxy-agent');

// Target Germany IPs
const agent = new HttpsProxyAgent('http://sub_xxx-country-DE:[email protected]:1318');

const response = await fetch('https://api.ipify.org', { agent });
const text = await response.text();
console.log(text);

got

const got = require('got');
const { HttpsProxyAgent } = require('https-proxy-agent');

const agent = new HttpsProxyAgent('http://sub_xxx:[email protected]:1318');

const response = await got('https://api.ipify.org', {
  agent: { https: agent }
});

console.log(response.body);

undici (Node.js 18+)

const { ProxyAgent, fetch } = require('undici');

const agent = new ProxyAgent('http://sub_xxx:[email protected]:1318');

const response = await fetch('https://api.ipify.org', {
  dispatcher: agent
});

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

Playwright

const { chromium } = require('playwright');

const browser = await chromium.launch({
  proxy: {
    server: 'http://p1.turnoxy.com:1318',
    username: 'sub_xxx-country-US',
    password: 'pass'
  }
});

const page = await browser.newPage();
await page.goto('https://api.ipify.org');
console.log(await page.textContent('body'));
await browser.close();

Puppeteer

const puppeteer = require('puppeteer');

const browser = await puppeteer.launch({
  args: ['--proxy-server=http://p1.turnoxy.com:1318']
});

const page = await browser.newPage();
await page.authenticate({
  username: 'sub_xxx-country-US',
  password: 'pass'
});

await page.goto('https://api.ipify.org');
console.log(await page.evaluate(() => document.body.textContent));
await browser.close();