Advertisement
dereksir

Untitled

May 11th, 2023 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import fetch from 'node-fetch';
  2. import { HttpsProxyAgent } from 'https-proxy-agent';
  3.  
  4. (async () => {
  5.   // Proxy configuration
  6.   const proxyHost = '200.105.215.22';
  7.   const proxyPort = 33630;
  8.  
  9.   // Target website URL
  10.   const targetUrl = 'https://ident.me/ip';
  11.  
  12.   // Proxy URL
  13.   const proxyUrl = `http://${proxyHost}:${proxyPort}`;
  14.  
  15.   // Create a new Proxy Agent
  16.   const proxyAgent = new HttpsProxyAgent(proxyUrl);
  17.  
  18.   // Fetch the target website using the proxy agent
  19.   const response = await fetch(targetUrl, { agent: proxyAgent });
  20.  
  21. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement