Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Import the Axios library
- const axios = require('axios');
- // Make a GET request to the target URL
- // with the following options:
- axios.get('https://httpbin.org/ip', {
- proxy: {
- protocol: 'http',
- // The hostname of ZenRows proxy server
- host: 'proxy.zenrows.com',
- // The port number
- port: 8001,
- // authentication credentials for the proxy server
- auth: {
- // Use your API_Key as your username
- username: 'API_key',
- // Set the premium proxy parameter as your password
- password: 'premium-proxy=true'
- },
- },
- })
- .then(res => {
- // Log the response data to the console
- console.log(res.data);
- })
- .catch(err => console.error(err)); // Log any errors to the console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement