Integrate proxies with Axios

    Use AnonEdge proxies with Axios using the built-in proxy option or an HTTPS proxy agent.

    1) Install Axios

    npm install axios

    Or via CDN:

    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

    2) Basic proxy configuration

    Use Axios proxy option to set protocol, host, and port. Example with AnonEdge:

    import axios from 'axios';
    
    const res = await axios({
      url: 'https://example.com',
      proxy: {
        protocol: 'http',
        host: 'gw.anonedge.com',
        port: 823,
        auth: { username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD' }
      }
    });
    
    console.log(res.data);

    3) HTTPS destinations using a proxy agent

    For HTTPS targets, you can supply an agent with credentials embedded:

    import axios from 'axios';
    import { HttpsProxyAgent } from 'https-proxy-agent';
    
    const username = 'YOUR_USERNAME';
    const password = 'YOUR_PASSWORD';
    // Note the escaped template placeholders and backticks for display purposes
    const agent = new HttpsProxyAgent(`http://${username}:${password}@gw.anonedge.com:823`);
    
    const res = await axios.get('https://ip-api.com/', { httpsAgent: agent });
    console.log(res.data);
    Tip: Use port 823 for HTTP/HTTPS rotating, 824 for SOCKS5 rotating, or sticky ports 10000–20000 when you need a stable IP.