title: HTTP requests in Capacitor hybrid mobile apps in virtual devices don't reach web server in development machine
body: <p>I'm working on a proof of concept for my company to demonstrate how our monorepo could benefit from Nx/Capacitor. So far, in my poc, I have a simple Nx monorepo with a backend app serving a couple of APIs, and I also have a React frontend connecting to the APIs, based on which I'm generating Android and iOS hybrid mobile apps with Capacitor using nxtend plugin for Nx (<a href="https://nxtend.dev/docs/capacitor/overview" rel="nofollow noreferrer">https://nxtend.dev/docs/capacitor/overview</a>)</p>
  <p>I'm not able to figure out how to make the Android and iOS applications running in the virtual devices to connect to the backend server in my development machine. When I access the web application in a browser in the development machine (and even in the browser of the virtual device), I get the result of the API, but from within the Android application, the API call returns the html file below instead. I tried switching out fetch with axios and capacitor-community/http in my React code to make http requests and still wasn't able to get the right response in the generated hybrid mobile apps with any of them (while the web app works fine in the browser in all cases). What could I be missing?</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;window.Capacitor = { DEBUG: true, isLoggingEnabled: true, Plugins: {} };
   window.WEBVIEW_SERVER_URL = 'http://localhost';
  
  /*! Capacitor: https://capacitorjs.com/ - MIT License */
  /* Generated File. Do not edit. */
  const nativeBridge = (function (exports) {
      'use strict';
      // For removing exports for iOS/Android, keep let for reassignment
      // eslint-disable-next-line
      let dummy = {};
      const initBridge = (w) =&gt; {
          const getPlatformId = (win) =&gt; {
              var _a, _b;
              if (win === null || win === void 0 ? void 0 : win.androidBridge) {
                  return 'android';
              }```
  </code></pre>