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.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
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.
Classes like WFS and GeoRSS use XMLHTTPRequest to get their data. If they are querying a remote server (anything other than the machine hosting your page), you must install a proxy script somewhere web accessible on that machine. See below for how to set up your own ProxyHost.
If the OpenLayers.ProxyHost variable is not set to a valid proxy host, requests are sent directly to the remote servers. In most cases, the result will be a security exception, although this exception often occurs silently.
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.