Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed use of xip.io, as it's not needed. #17642

Closed
wants to merge 2 commits into from

Conversation

jvranish
Copy link

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 http://_your-local-ip-address_.xip.io:8081/.

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

Motivation

Background:
The automatic IP detection feature (introduced here) is super handy. However, it’s use of xip.io 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, which helps.

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

Based on this comment, it appears the original reason for using xip.io 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 http://www.google.com you will get an error due to ATS.
However, you can make the same request to http://172.217.6.14/ (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 xip.io with ATS exceptions is unnecessary, causes some very annoying problems for some people, and I think it should just be removed.

Test Plan

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

Related PRs

Implemented automatic IP detection for iOS #8091
Added option to disable xip #13326

Release Notes

[INTERNAL] [BUGFIX] [./scripts] - Removed use of xip.io

@pull-bot
Copy link

pull-bot commented Jan 17, 2018

@facebook-github-bot label Android

Generated by 🚫 dangerJS

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. cla signed labels Jan 17, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@janicduplessis
Copy link
Contributor

Makes sense and test plan looks good! Thanks 👍

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jan 25, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicduplessis is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos
Copy link
Contributor

hramos commented Jan 26, 2018

Can you rebase and import again? There was an internal directory change that basically means any PR that is imported has to be rebased past a certain commit for it to land cleanly. Clicking on Update branch above should do it.

@janicduplessis
Copy link
Contributor

@facebook-github-bot shipit

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicduplessis is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants