I am building a React Native app using Expo. The app sends some network requests via axios, i am trying to send these requests through a proxy but it seems my IP is still the originating source.
Here is my sample code:
(async () => {
const res = await axios.get("https://api.ipify.org?format=json", {
proxy: {
host: "gb.smartproxy.com",
port: "440066",
auth: {
username: "user",
password: "password"
}
}
});
console.log(res.data);
})();
I have tried with fetch()
and also https-proxy-agent however neither seem to work.
Is there a way i can send network requests using React Native through a proxy?
question from:
https://stackoverflow.com/questions/65909020/proxy-network-requests-via-react-native 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…