Q: Conflicts between localhost and Local IP address - OpenLayers I'm having some troubles trying to visualize a tile-based map using OpenLayers. 
My whole application (html, css, js and maptiles) is deployed on VirtualBox. But, when I try to access from my local machine to the map using a web browser, the map doesn't appear.
The JavaScript file contains the following lines:
var tiles = new ol.layer.Tile({
    title: 'Natural Earth',
    type: 'base',
    source: new ol.source.XYZ({
        url: 'http://localhost:8080/geoserver/www/ol_map3/{z}/{x}/{y}.png',
        attributions: 'Made with Natural Earth and TilesXYZ'
    })
})

var map = new ol.Map({
    target: 'map',
    layers: [tiles],
    view: new ol.View({
        center: ol.proj.fromLonLat([-4.72, 41.66]),
        zoom: 5
    }),
    renderer: 'canvas'
});


However, if I change the url of the tiles' source, using the local IP (192.168.56.101), the map appears on my local machine.
I don't understand what's happening...
Does anyone have an idea about the problem? Why can't I use 'localhost' instead of 192.168.56.101?
