Closed lightSoulDev closed 6 months ago
Hi @lightSoulDev! Thanks for the PR, unfortunately this change was made on already deprecated parts of the global Expo CLI. This has been replaced by the versioned CLI.
If you think we should still move forward with this PR, please reopen the PR on github.com/expo/expo.
Hope this helps!
Why
This pull request enhances the
expo start --tunnel
experience by introducing new environment variables and conditional logic for more control over the Ngrok tunnel setup. Specifically, it allows skipping the creation of a tunnel if theEXPO_TUNNEL_SKIP_CONNECT
environment variable is set (EXPO_TUNNEL_USE_HTTPS must be set if that tunnel uses https protocol). Additionally, it provides the flexibility to use a custom Ngrok domain via theNGROK_HOSTNAME
,NGROK_AUTHTOKEN
, andNGROK_PORT
environment variables.Changes Made
EXPO_TUNNEL_SKIP_CONNECT
andNGROK_HOSTNAME
environment variables.EXPO_TUNNEL_USE_HTTPS
environment variable for specifying HTTPS protocol usage.connectToNgrokInternalAsync
method to incorporate these changes.New Environment Variables
EXPO_TUNNEL_SKIP_CONNECT
: If set, the tunnel creation process is skipped.EXPO_TUNNEL_USE_HTTPS
: must be set if existing tunnel is using https protocol.NGROK_HOSTNAME
: Allows specifying a custom Ngrok domain.NGROK_AUTHTOKEN
: Ngrok auth token.NGROK_PORT
: Allows specifying a custom port for the tunnel.Usage Examples
If existing tunnel is using https
EXPO_TUNNEL_SKIP_CONNECT=1 EXPO_TUNNEL_USE_HTTPS=1 expo start --tunnel
Test Plan
I have been using these changes as
patches
for some time. I had to ensure that my app works as expected outside of my homelab. I set up a test HTTPS tunnel and needed this changes for Expo Go to work properly.P.S. Simply running
npx expo start
with a specified port (e.g., 8181) did not yield the desired results. This issue arose when attempting to scan a QR code, as Expo Go was attempting to download an update from a URL structured as http://example.com:8181/...Examples for testing are listed above. Sorry if I did sth wrong. Example output