I am working on a React Native project under a corporate proxy. How can I set it properly so that I can build the application (react-native run-android
or Double R
for reloading) and having access to internet on the device ?
PS : I'm using Windows and executing my code on a Android Emulator from Android Studio.
I tried multiple things ( https://medium.com/@Charles_Stover/create-a-react-native-app-on-an-android-emulator-1c0d94f288ae, ... ):
Without any configuration, the build works find but using fetch always returns a timeout (and accessing to chrome application, I do not have access to internet).
I configured the proxy in the wifi of the device (Settings > Network & Internet > Wi-Fi > AndroidWifi > Modify Network > Set Proxy
)
- Proxy
Manual
- hostname
proxy.company.int
- port
80
- bypass proxy for
10.x.y.z, 192.168.x.y, localhost, *.local
I can access to internet (both in the previously built application and with Chrome) but could not either reload the application or rebuild it (a white screen appears).
I tried a lot of different things for no_proxy (based on ipconfig which gave me 2 IPs, one private (10.x.y.z) and one public (192.168.x.y). None of them worked so far.
I also tried to configure the parameters of Android Studio > File > Settings > Appearance & Behaviour > System Settings > HTTP Proxy
with the same config, without good results.
I also tried to configure the parameters of the device (not the wifi directly but the options in the toolbar next to the emulated device) : ... > Settings > Proxy > Use Android Studio HTTP proxy settings / no proxy / manual proxy configuration
.
Environment :
Windows 10 React-native 0.55.4 Android Studio 2.3.3
Thanks in advance