Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...