Are local files always served via HTTP?


#1

Hi!

I have a game written in JavaScript, but it only works if the scripts are served via the http protocol, and not the file protocol.

Because of this, it doesn’t work with Cordova, so I tried Capacitor and everything worked flawlessly on my phone.

It is written here that HTTPS is used to load local assets on Android. Is it also the case on iOS? I can’t check because I don’t have a Mac right now.

I’d also like to be sure that it’s something that won’t change in the future and that my game won’t break with future versions of Capacitor.

Thanks!


#2

Capacitor uses https on Android and http on iOS. It could also use http on Android, but it can’t use https on iOS (at least for now)

We don’t plan to change it in the future.


#3

Thanks for the precision! As long as the file protocol isn’t used, I should be good.

Capacitor looks great, by the way. I don’t have a lot of experience in this domain, but I found Capacitor really straightforward compared to Cordova.