Android emulator https issue

I am developping an ionic/angular 8 and capacitor 6 mobile app. I built the ionic/angular and opened it in android studio 2024.` but when i run the emulator, it shows the https instead http. How can i resolve this issue. The mobile app uses http apis written with express.js backend.
Here is the error :
File: https://localhost/polyfills.a945b0249cb630b5.js - Line 1 - Msg: Mixed Content: The page at ‘https://localhost/login’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://192.168.0.90:3000/authenticate’. This request has been blocked; the content must be served over HTTPS.

How can i disabled https. Please help.

1 Like

In Capacitor 6, HTTPS is default for Android. You have two options.

You could set android.allowMixedContent to true in your Capacitor config (not meant for production).

Or, set server.androidScheme to http in the config.

Hopefully you’ll be using HTTPS for your API endpoint in production :smile:

1 Like

Thank you @twestrick. Now i understand.