[MapProxy] Unable to use OpenLayers.ProxyHost for protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer)

vinod sharma veenu22sharma at yahoo.com
Fri Dec 24 04:32:32 EST 2010

Hello all

I am a new bee in open source development, for learning i start with the basic 
examples. I download the proxy.cgi, change it to proxy.py (Working with IIS), 
implemented each and every step on net. but I am unable to use proxy.py. when i 
check manually (http://localhost:80/proxy.py) it is giving 

Some unexpected error occurred. Error text was: <urlopen error (10061, 
'Connection refused')>

Iam using my college internet for this, which may contain firewalls. I kno it is 
a TCP/IP error.

My Question is can we use localhost as the proxy server.

below is my code, Thanks for any help in advance. As it keep my interest in Open 
source development
& learning
  I try calling WMS from both Geoserver on http://localhost:85 & from remote WMS 


   <link rel="stylesheet" href="../OpenLayers-2.10/theme/default/style.css 
type="text/css" />
  <link rel="stylesheet" href="style.css" type="text/css" />
    <title>WFS: GetFeature Example (GeoServer)</title>

 <script type="text/javascript">
        var map, layer, select, hover, control;

        function init(){
            OpenLayers.ProxyHost= "/cgi-bin/proxy.py?url=";
            map = new OpenLayers.Map('map', {
                controls: [
                    new OpenLayers.Control.PanZoom(),
                    new OpenLayers.Control.Permalink(),
                    new OpenLayers.Control.Navigation()
            layer = new OpenLayers.Layer.WMS(
                "States WMS/WFS",
                {layers: 'usa:states', format: 'image/gif'}
             layer2 = new OpenLayers.Layer.WMS( "India ",
                                {   "layers": "india_gc:ind_g_polygon",
                                    "format": "image/png",
                                    "version": "1.1.1",
                                    "transparent": "TRUE",
                                    "SLD_BODY": theSLD_BODY
            select = new OpenLayers.Layer.Vector("Selection", {styleMap:
                new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])

            hover = new OpenLayers.Layer.Vector("Hover");
            map.addLayers([layer, hover, select]);

            control = new OpenLayers.Control.GetFeature({
                protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
                box: true,
                hover: true,
                multipleKey: "shiftKey",
                toggleKey: "ctrlKey"
            control.events.register("featureselected", this, function(e) {
            control.events.register("featureunselected", this, function(e) {
            control.events.register("hoverfeature", this, function(e) {
            control.events.register("outfeature", this, function(e) {


  <body onload="init()">
<h1 id="title">WFS GetFeature Example (GeoServer)</h1>

<div id="tags">
WFS, GetFeature

<p id="shortdesc">
    Shows how to use the GetFeature control to select features from a WMS layer.

<div id="map" class="smallmap"></div>

<div id="docs">



With Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapproxy/attachments/20101224/04c84187/attachment.html

More information about the MapProxy mailing list