I am trying to setup a local HTTPS tunnel with services like ngrok or localtunnel. It works fine in Chrome on macOS. But if I try to open the same page on my iPhone, I get a blank page.
The reason is that Meteor tries to download modules and other files (e.g. universe:i18n localization files) using the original localhost URL instead of the tunnel’s public URL.
Thanks, but I don’t think this would help in this case. I’m already using this API for getting absolute URLs to my app if I let users share links etc. But my issue is related by the way Meteor generates the links for HMR and bundle loading. I think @sussition’s approach could work. Will try it out and report back.
It’s interesting that it works in a desktop Chrome browser. Shouldn’t Chrome block local host access as well if the server is running on a HTTPS domain? I checked the Network tab and saw that it is actually allowing fetch to localhost. The only error I get in Chrome is this one:
BTW: I saw a quite old Meteor package called tarang:ssl, which would allow me to embed such a proxy directly in the Meteor app. But this also fails as of 2024. At least with a self-signed certificate, because Chrome / macOS block this certificate and I did not find a way to workaround this. And maybe even if I did, it would be affected by the same issues as ngrok et al. again.
That’s weird, looks like your absoluteUrl() is being overwritten somewhere. I had a look at the universe:i18n package and it seems to reference absoluteUrl().
Are you running anything that may be overriding your ROOT_URL? Anything in your npm/node environment variables?