Skip to content
Browse files

Removed use of, as it's not needed.

By default, when a react-native app launches in development mode on a physical iOS device, it attempts to load the JS bundle from a packager at ``.

This change removes the use of ``, which changes that url to: `http://_your-local-ip-address_:8081/`

Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here:

Happy contributing!


The automatic IP detection feature (introduced [here](#8091)) is super handy. However, it’s use of `` has caused myself and others much grief.  Some routers do not allow or have intermittent errors when trying to resolve DNS names to local IP addresses. This prompted the introduction of a [DISABLE_XIP feature](#13326), which helps.

However, I don’t believe the use of `` is needed at all.

Based on [this comment](8c29a52#commitcomment-18224788), it appears the original reason for using `` was to “circumvent the numeric IP address limitation in ATS”.

But, the reason you can’t create ATS exceptions for raw IP addresses is that ATS is not enforced for raw IP addresses _at all_. You can read the Apple documentation [here](, the relevant portion is:

> App Transport Security (ATS) applies only to connections made to public host names. The system does not provide ATS protection to connections made to:
> * Internet protocol (IP) addresses
> * Unqualified host names
> * Local hosts employing the .local top-level domain (TLD)

For example, in iOS, if you attempt to make an http request (note: _not_ https) to `` you will get an error due to ATS.
However, you can make the same request to ``  (which for me is the same server) and the request will succeed.

And in fact, if an ATS exception _was_ needed, the DISABLE_XIP feature shouldn’t work at all, but it does.

In short, using `` with ATS exceptions is unnecessary, causes some very annoying problems for some people, and I think it should just be removed.

Run the app on a physical iOS device and verify that it can load the JS bundle from the host computer's IP.

[Implemented automatic IP detection for iOS #8091](#8091)
[Added option to disable xip #13326](#13326)

Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|



 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
 [INTERNAL] [BUGFIX] [./scripts] - Removed use of
Closes #17642

Differential Revision: D6814609

Pulled By: hramos

fbshipit-source-id: f2faebd6a29b0b211d78cdfe8e195906307ab552
  • Loading branch information...
Job Vranish authored and facebook-github-bot committed Jan 26, 2018
1 parent 46fd864 commit 40a8434bde855ecae42408ec1240622152432de7
Showing with 0 additions and 8 deletions.
  1. +0 −8 scripts/
@@ -95,19 +95,11 @@ set -x

if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then
IP=$(ipconfig getifaddr en0)
if [ -z "$IP" ]; then
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}')

if [ -z ${DISABLE_XIP+x} ]; then

$PLISTBUDDY -c "Add NSAppTransportSecurity:NSExceptionDomains:localhost:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true" "$PLIST"
$PLISTBUDDY -c "Add NSAppTransportSecurity:NSExceptionDomains:$IP:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true" "$PLIST"
echo "$IP" > "$DEST/ip.txt"

1 comment on commit 40a8434


This comment has been minimized.

Copy link

wadim commented on 40a8434 Jun 21, 2018

Would be great to update the docs on this too, @jvranish

Please sign in to comment.
You can’t perform that action at this time.