<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-7" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi George,<br>
<br>
maybe you indeed need a proxy. You are running your servers in a same
host, but in different ports, right? I'm not an expert on this, but I
think that's the case. From the proxy point of view, they're not a same
host.<br>
I am still thinking that this could be an IIS related problem. I tried
your proxy and it seemed to be working when accessing openlayers.org or
openstreetmap.org. But when I tried to access your server (Jetty?), I
get these:<br>
<br>
<a class="moz-txt-link-freetext" href="http://84.205.237.73/script/proxy.py?url=http://84.205.237.73:443/geoserver/">http://84.205.237.73/script/proxy.py?url=http://84.205.237.73:443/geoserver/</a><br>
<pre>Some unexpected error occurred. Error text was: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond></pre>
- mika -<br>
<br>
P.S. I think you could also set some proxy up in your IIS so that e.g.
all the requests made to host/geoserver/ would redirect to host:443/ or
something like that..<br>
<br>
george gpoul48 kirjoitti:
<blockquote cite="mid:SNT105-W35F48BAABC5A6962CABF7AA2AE0@phx.gbl"
type="cite">
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>It is working without proxy only in localhost, but not from
the internet. That is why i used proxy. Is it possible to run without
proxy? Regarding iis i have no idea what it should be. IIS configured
and tested to run python without problem. Any idea?<br>
<br>
thank you all for your concern<br>
<br>
<hr id="stopSpelling">
Date: Mon, 23 Feb 2009 11:02:36 +0200<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:mika@digikartta.net">mika@digikartta.net</a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:igrcic@gmail.com">igrcic@gmail.com</a><br>
CC: <a class="moz-txt-link-abbreviated" href="mailto:gpoul48@hotmail.com">gpoul48@hotmail.com</a>; <a class="moz-txt-link-abbreviated" href="mailto:users@openlayers.org">users@openlayers.org</a><br>
Subject: Re: [OpenLayers-Users] proxy not working<br>
<br>
Hi Ivan and George,<br>
<br>
I just tested the site and it seems that the request sent works. Also
the proxy works. But do you need proxy when using GetFeatureInfo?<br>
<br>
maybe this has something to do with IIS?<br>
<br>
- mika -<br>
<br>
Ivan Grcic kirjoitti:
<blockquote
cite="mid:f30fafda0902230058t4440aabdqe4e1bc293cf82166@mail.gmail.com">
<pre>Hi,
first check if the normal request is working, without proxy. What does
firebug say if its not working?
On Mon, Feb 23, 2009 at 9:26 AM, george gpoul48 <a
moz-do-not-send="true" class="EC_moz-txt-link-rfc2396E"><gpoul48@hotmail.com></a> wrote:
</pre>
<blockquote>
<pre>Hallo everyone!!
I use this proxy.py file and i am trying to get information for a map
feature clicking on it, but the computer returns this message:
"Some unexpected error occurred. Error text was:" Can anyone help me? Where
am i wrong?
See my map at <a moz-do-not-send="true" class="EC_moz-txt-link-freetext">http://84.205.237.73/default/mytest.aspx</a>
Proxy.py code
#!C:/Python26/python.exe -u
import urllib2
import cgi
import sys, os
# Designed to prevent Open Proxy type stuff.
allowedHosts = ['84.205.237.73:443', '<a moz-do-not-send="true"
class="EC_moz-txt-link-abbreviated">www.openlayers.org</a>', 'openlayers.org',
'labs.metacarta.com', 'world.freemap.in',
'prototype.openmnnd.org', 'geo.openplans.org',
'sigma.openplans.org',
'<a moz-do-not-send="true"
class="EC_moz-txt-link-abbreviated">www.openstreetmap.org</a>']
method = os.environ["REQUEST_METHOD"]
if method == "POST":
qs = os.environ["QUERY_STRING"]
d = cgi.parse_qs(qs)
if d.has_key("url"):
url = d["url"][0]
else:
url = <a moz-do-not-send="true" class="EC_moz-txt-link-rfc2396E">"http://www.openlayers.org"</a>
else:
fs = cgi.FieldStorage()
url = fs.getvalue('url', <a moz-do-not-send="true"
class="EC_moz-txt-link-rfc2396E">"http://www.openlayers.org"</a>)
try:
host = url.split("/")[2]
if allowedHosts and not host in allowedHosts:
print "Status: 502 Bad Gateway"
print "Content-Type: text/plain"
print
print "This proxy does not allow you to access that location (%s)."
% (host,)
print
print os.environ
elif url.startswith(<a moz-do-not-send="true"
class="EC_moz-txt-link-rfc2396E">"http://"</a>) or url.startswith(<a
moz-do-not-send="true" class="EC_moz-txt-link-rfc2396E">"https://"</a>):
if method == "POST":
length = int(os.environ["CONTENT_LENGTH"])
headers = {"Content-Type": os.environ["CONTENT_TYPE"]}
body = sys.stdin.read(length)
r = urllib2.Request(url, body, headers)
y = urllib2.urlopen(r)
else:
y = urllib2.urlopen(url)
# print content type header
i = y.info()
if i.has_key("Content-Type"):
print "Content-Type: %s" % (i["Content-Type"])
else:
print "Content-Type: text/plain"
print
print y.read()
y.close()
else:
print "Content-Type: text/plain"
print
print "Illegal request."
except Exception, E:
print "Status: 500 Unexpected Error"
print "Content-Type: text/plain"
print
print "Some unexpected error occurred. Error text was:", E
------------------------------------------------------------------
getfeatureinfo code
.
.
.
OpenLayers.ProxyHost = "/script/proxy.py?url=";
.
.
.
map.events.register('click', map, function (e) {
document.getElementById('nodelist').innerHTML = "Please
wait...";
var params = {
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "application/vnd.ogc.se_xml",
BBOX: map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html',
QUERY_LAYERS: map.layers[0].params.LAYERS,
FEATURE_COUNT: 50,
Layers: 'Tinos:dimoi',
Styles: '',
Srs: 'EPSG:900913',
WIDTH: map.size.w,
HEIGHT: map.size.h,
format: format};
OpenLayers.loadURL(<a moz-do-not-send="true"
class="EC_moz-txt-link-rfc2396E">"http://84.205.237.73:443/geoserver/wms"</a>, params, this,
setHTML, setHTML);
OpenLayers.Event.stop(e);
});
// sets the HTML provided into the nodelist element
function setHTML(response){
document.getElementById('nodelist').innerHTML =
response.responseText;
};
________________________________
Κάντε κλικ για να παίξετε Fishticuffs με τους φίλους σας, τώρα! Κάντε κλικ
εδώ!
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="EC_moz-txt-link-abbreviated">Users@openlayers.org</a>
<a moz-do-not-send="true" class="EC_moz-txt-link-freetext">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre>
</pre>
</blockquote>
<br>
<hr>Φέρτε τους φίλους σας από το Facebook και το Hotmail στον
Messenger ΤΩΡΑ! <a moz-do-not-send="true"
href="www.invite2messenger.net%20" target="_new">Κάντε κλικ εδώ!</a>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>