Advertisement
dereksir

Untitled

Mar 13th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. // Import the Axios library
  2. const axios = require('axios');
  3.  
  4. // Make a GET request to the target URL
  5. // with the following options:
  6. axios.get('https://httpbin.org/ip', {
  7. proxy: {
  8. protocol: 'http',
  9. // The hostname of ZenRows proxy server
  10. host: 'proxy.zenrows.com',
  11. // The port number
  12. port: 8001,
  13. // authentication credentials for the proxy server
  14. auth: {
  15. // Use your API_Key as your username
  16. username: 'API_key',
  17. // Set the premium proxy parameter as your password
  18. password: 'premium-proxy=true'
  19. },
  20. },
  21. })
  22. .then(res => {
  23. // Log the response data to the console
  24. console.log(res.data);
  25. })
  26. .catch(err => console.error(err)); // Log any errors to the console
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement