Answer the question
In order to leave comments, you need to log in
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("> Прокси не работает!");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question