Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import fetch from 'node-fetch';
- import { HttpsProxyAgent } from 'https-proxy-agent';
- (async () => {
- // Proxy configuration
- const proxyHost = '200.105.215.22';
- const proxyPort = 33630;
- // Target website URL
- const targetUrl = 'https://ident.me/ip';
- // Proxy URL
- const proxyUrl = `http://${proxyHost}:${proxyPort}`;
- // Create a new Proxy Agent
- const proxyAgent = new HttpsProxyAgent(proxyUrl);
- // Fetch the target website using the proxy agent
- const response = await fetch(targetUrl, { agent: proxyAgent });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement