Proxies
- Residential Proxies
- ISP Proxies
- Datacenter Proxies
- Mobile Proxies
- Authentication Methods
Integrations
- Operating System
- Browser
- Code
- Proxy Managers
Code
JavaScript
Learn how to use JavaScript to make requests with proxies.
playwright
const { chromium } = require('playwright');
const proxyConfig = {
server: 'http://proxy.antsdata.com:40000',
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)