You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2022/10/05 19:55:58 UTC

[GitHub] [cordova] breautek commented on issue #345: ERR_CONNECTION_REFUSED despite access origin=* and correct content-secutiy-policy

breautek commented on issue #345:
URL: https://github.com/apache/cordova/issues/345#issuecomment-1264692134

   Just for context, Android emulators are full virtual machines with their own virtual network stack. Therefore `localhost` will resolve to itself, the virtual machine, rather than the host machine. Physical devices will work the same way.
   
   Additionally, if you're using schemes via `<preference name="hostname" value="localhost" />` then the webview will (in simple terms) intercept `http://localhost` or (`https://localhost` if `scheme` is set to `https`) and remap urls to load from the local file system. It somewhat behaves like a virtual webserver that only the process itself can have access to.
   
   That is why changing the url to use a private IP `https://10.0.0.2` works. On mac/linux, you can look up your private ip using the `ifconfig` command, most home networks uses a `192.168.x.x` ip scheme


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org