[menu-bar] Add local HTTP server to circumvent deep-link limitations #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Closes ENG-9945
This will allow us to remove the need for an "Enable Orbit" option inside User Settings, given that we can just fetch the local server from the website and verify if Orbit is running. As long as Orbit is open, the "Open with Orbit" button will be displayed.
One other advantage of having a local HTTP server is the ability to check the version that is installed in the user's computer and potentially show different options, this could be necessary in the future when we add new features to Orbit.
How
This PR adds
Swifter
as a CocoaPods dependency, providing us a tiny and versatile HTTP server engine.The set of possible ports used for this are 35783, 47909, 44171, and 50799, and were chosen randomly. All ports are unassigned and are not used by any largely known applications.
This first version of the HTTP server has two endpoints,
/orbit/status
andorbit/open
and both require Origin and Refer headers from expo domains, this is to prevent other potentially malicious websites from fetching the local serverTest Plan
/orbit/status
/orbit/open
Screen.Recording.2023-09-01.at.17.02.14.mov