inspectdev / inspect-issues

Issue tracker for Inspect
23 stars 2 forks source link

Support localhost as URL in iOS Safari to connect to the desktop server #165

Open SuperPat45 opened 1 year ago

SuperPat45 commented 1 year ago

Chrome debugger have a very cool thing:

When the chrome desktop is connected to an android smartphone, we can use localhost as URL in the android chrome browser like: http://localhost:8080 to connect to the desktop server (where the smartphone is connected in USB) instead of using the real IP of the desktop.

The big advantage of this technique is that the site is considered secure even when we don't use the https protocol. Which allow to test API like serviceworker, geolocation, mediarecorder... (window.isSecureContext === true)

With this, we can also copy/paste localhost URL's to the inspect.dev url bar directly.

Would it be possible to do the same thing on Safari iOS when indepect.dev is connected?

auchenberg commented 1 year ago

Thanks for this request @SuperPat45!

Right now we are dependent on the APIs exposed from Apple, and to enable this we would need some port mapping features and access to the networking stack – which we don't have.

For now our recommendation is to use https://ngrok.com/ or similar.

We absolutely want to land this, once possible.