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

Ngrok is giving blank page when https://localhost:443 works perfectly #816

Open
milkeshaa opened this issue May 24, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@milkeshaa
Copy link

milkeshaa commented May 24, 2024

Describe you feature request

When using ngrok with the basic/default setup of Franken server on docker everything works locally (i.e. https://localhost works as expected), but created by ngrok https URL gives an empty blank page.

ngrok http https://localhost gives created by ngrok https URL which leads to always blank page, but I expect it to lead to my local machine the same way as https://localhost:443 does.

So not sure if I'm missing something and didn't setup the local env properly, or franken package needs to be updated in some way to handle this functionality somehow.

I would expect ngrok generated URL to work the same way as localhost works.

@milkeshaa milkeshaa added the enhancement New feature or request label May 24, 2024
@milkeshaa milkeshaa changed the title Ngrok is giving blank page when https://localhost:443 work perfectly Ngrok is giving blank page when https://localhost:443 works perfectly May 24, 2024
@withinboredom
Copy link
Collaborator

I suspect this might be due to a fairly common misconception in software where someone hardcoded 127.0.0.1 as localhost instead of doing a DNS lookup for localhost which usually returns 127.0.0.1 for ipv4 and ::1 for ipv6. These are two separate addresses with the same hostname.

So, most likely, with the limited details I have at hand, ngrok likely doesn't know how to route to FrankenPHP because one is listening on 127.0.0.1 and the other is trying to connect to ::1 (or vice-versa). One way to fix this is to make sure localhost is defined as exactly one of these addresses in your /etc/hosts file and/or define the exact address using the SERVER_NAME environment variable when starting FrankenPHP:

SERVER_NAME=https://127.0.0.1 frankenphp ...
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants