[GIS] we use a proxy script for Apache, Geoserver, OpenLayers2

apachegetfeatureinfoopenlayers-2PROXY

I can't understand why we use proxy (OpenLayers.ProxyHost) for WMS GetFeatureInfo request in OpenLayers. I am using OpenLayers 2.10, Apache-Tomcat-6.0.35 and GeoServer.

Why we use proxy?
How should use?

I am new to web development.

Best Answer

to avoid the cross origin policy that prevents evil sites from stealing your credit card details by accident. See http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#WhydoIneedaProxyHost for more details.