-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Conversation
Removed use of xip.io as it's not needed. ATS doesn't apply to raw IP addresses, see: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
@facebook-github-bot label Android Generated by 🚫 dangerJS |
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 [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Makes sense and test plan looks good! Thanks 👍 @facebook-github-bot shipit |
There was a problem hiding this 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.
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. |
@facebook-github-bot shipit |
There was a problem hiding this 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.
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:
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