well, it seems that the obvious was at play here. The 'text/plain' mimetype was the cause of the issue. Once i added this to GeoServer's proxy mimetypes and changed my proxy to be "localhost:80" then everything worked.
For future people seeing this post i tested it using JQuery. The GET request looks like this:
$.get("/geoserver/rest/proxy?url=localhost:80/myapp";, {format : 'text/plain'}, function(data){console.log(data); })
you can check this example on openlayers.
OpenLayers.ProxyHost = "proxy.cgi?url=";
var map;
function load() {
map = new OpenLayers.Map('map', {
maxExtent: new OpenLayers.Bounds(143.834,-43.648,148.479,-39.573)
});
var political = new OpenLayers.Layer.WMS("State Boundaries",
"http://demo.opengeo.org/geoserver/wms",
{'layers': 'topp:tasmania_state_boundaries',
transparent: true, format: 'image/gif'},
{isBaseLayer: true}
);
};
map.addLayer(political);
if it didnt help you, you can read Open Layer with GeoSever example.
EDIT:
for wms get info function you have to add this code to which i have gave before:
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://demo.opengeo.org/geoserver/wms',
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"chicken",
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true
));
}
}
});
map.addControl(info);
info.activate();
i hope it helps you...
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.