Hi Phil,<div><br></div><div>Thanks again for your guidance. I am bit confused when you said,</div><div><br></div><div>have a proxy page INSIDE YOUR APPLICATION - ie<br>in the same directory as your page or in a subdirectory below it.</div>


<div><br></div><div>Did u mean that I should have my py script to which I making the AJAX request in the same dir? Then I already have. Only issue is that, the script is running on port 9000 (<a href="http://128.196.142.94:9000/info?lat=53.33935546875&lon=-121.99951171875" target="_blank">http://128.196.142.94:9000/info?lat=53.33935546875&lon=-121.99951171875</a>). So the domain is same but the ports are different.<br>


<br>check that the passed URL is reasonable for the application to call</div><div><br></div><div>I was able to call py script url (wget "<a href="http://128.196.142.94:9000/info?lat=53.33935546875&lon=-121.99951171875" target="_blank">http://128.196.142.94:9000/info?lat=53.33935546875&lon=-121.99951171875</a>" -o test.1.log -O test.1), u can run this on terminal and it should fetch you the JSON.</div>


<div><br></div><div>So, after this, how should I complete the other two parts?</div><div><br></div><div> 2/ Open an http connection to the passed page<br>3/ pipe the page content as output.</div><div><br></div><div>Thanks & Regrads,</div>


<div>Smaran<br><br><div class="gmail_quote">On Sun, Aug 19, 2012 at 3:08 PM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><br>
> I am using bottle to respond to the lat n long which has been sent.<br>
> Since I am not using CGI, using the cgi proxy is not helping. Also I<br>
> did try using cgi proxy but it made no difference.<br>
</div>Proxy is absolutely the way to get around cross-origin conflicts. Ajax<br>
uses XHR which necessarily has much tougher cross-origin policies.<br>
The way this works is to have a proxy page INSIDE YOUR APPLICATION - ie<br>
in the same directory as your page or in a subdirectory below it.(so it<br>
is absolutely NOT a cross origin). The proxy page is code that needs to<br>
do this:<br>
1/ check that the passed URL is reasonable for the application to call.<br>
If you dont do this, then you are creating an open proxy that can be<br>
used by spammers, anonymomizers, etc.<br>
2/ Open an http connection to the passed page<br>
3/ pipe the page content as output.<br>
<br>
If you are returning json though, you can could instead look at using<br>
the openlayers script protocol. It depends on wrapping the returned json<br>
in a function call. (JSONP method if you want to read up on it).<br>
<br>
However, I would say getting a working proxy up will save you a lot of<br>
grief.<br>
<br>
Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.<br>
<div><div><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br><br><br>
</div>