E
E
EvgenyJS2021-05-30 13:50:27
Node.js
EvgenyJS, 2021-05-30 13:50:27

How to double proxy an Axios.js request?

I am making an online proxy check service on NodeJS. And the fact is that users began to make their own fake proxies and thereby look at the real IP of the checking server.

I made global proxies on Ubuntu so that a request was thrown through them for user ones, but this does not work.

const axios = require("axios");
const ProxyAgent = require("socks-proxy-agent");

let proxy = 'прокси';

let options = {
   method: "GET",
   url: "https://www.google.com/",
   httpsAgent: new ProxyAgent("socks://" + proxy),
};

try {
   var response = await axios(options);
} catch (e) {
   console.log(e.response.data);
   throw new Error("> Прокси не работает!");
}


What would you advise in this situation? How to make a layer of 2 proxies to send a request?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question