Opened 20 years ago

Last modified 13 years ago

#571 closed defect

[WMS/WFS] Ability to specify a proxy for remote connections — at Version 20

Reported by: dmorissette Owned by: mapserverbugs
Priority: high Milestone: 5.2 release
Component: Documentation - MapServer Version: 4.1
Severity: normal Keywords:
Cc: mapserver@…, bartvde@…, franck.villoin@…, tjmitchell@…, micheal.arnold@…, pierrick.brihaye@…, jcampanello@…, mko

Description (last modified by dmorissette)

We need the ability to specify a proxy when connecting to remote WMS/WFS servers.

This could possibly be added as layer metadata wms_proxy_*, but I wonder if we should instead create global configuration parameters inside the WEB object?

I never really worked in environments with proxies, so I wonder if it is safe to assume that when someone uses a proxy, then they use it for *all* their http connections and not only to get to specific hosts? i.e. is it a good idea to have a single global proxy setting in the web object in the mapfile or should this be local at the layer level?

Change History (21)

comment:1 by fwarmerdam, 20 years ago

I agree that this should be map wide, rather than layer specific.  

I am not sure it belongs in the WEB section though, since it relates to 
how remote requests are made, now how the local configuraton works.  

There are also a number of other global configuration options I would like
to add in the not-to-distant-future, including .map file driven overrides for
GDAL_DATA, and PROJ_LIB.   I'm not sure that these are related though. 

comment:2 by bartvde@…, 20 years ago

The production environments I have been in would only need to have a global 
proxy setting in the MAP file, not a per layer proxy setting.

comment:3 by mapserver@…, 20 years ago

Cc: mapserver@… added

comment:4 by dmorissette, 20 years ago

Milestone: 4.2 release

comment:5 by franck.villoin@…, 20 years ago

Cc: franck.villoin@… added

comment:6 by franck.villoin@…, 20 years ago

Attention, we can imagine use Services WMS without proxy for certain layers in 
the Intranet, and others services WMS/WFS out of intranet use the proxy.
But I use only one the proxy in my production environment. 

comment:7 by dmorissette, 20 years ago

Franck, what would happen in your case if you tried to access a WMS server from
the intranet via the proxy?  Would things still work?

comment:8 by franck.villoin@…, 20 years ago

No, it does not function. 
If I pass by my proxy, the addresses of my Intranet are not solved.
By fixing the proxy in a permanent way in my navigator,
I do not see any more the sites of my Intranet.

Is it possible to define a global proxy parameter, and to make it active by 
layer if necessary?

Franck

comment:9 by dmorissette, 20 years ago

Milestone: 4.2 release4.4 release
Pushing to 4.4 release

comment:10 by tjmitchell@…, 20 years ago

Cc: tjmitchell@… added

comment:11 by tjmitchell@…, 20 years ago

I also need this functionality due to some relocation of our servers.  Our 
proxy requires our username/password too!  Ugh.

Curl docs say:

"NOTE2: libcurl respects the environment variables http_proxy, ftp_proxy, 
all_proxy etc, if any of those is set."

Can this be used somehow as a quick workaround?

Tyler

comment:12 by dmorissette, 20 years ago

The libcurl tutorial talks about those environment variables as well. They must
be lowercase, and the value is in the format
"[protocol://][user:password@]machine[:port]". They also note that the
"protocol://" part is simply ignored if present. (Proxies are always http).

Tyler, I think the best way to go is for you to try this and let us know if that
works.

comment:13 by micheal.arnold@…, 19 years ago

Cc: micheal.arnold@… added

comment:14 by dmorissette, 19 years ago

Milestone: 4.4 releaseFUTURE
Not in 4.4. Setting FUTURE target milsetone.

comment:15 by pierrick.brihaye@…, 19 years ago

Cc: pierrick.brihaye@… added

comment:16 by bartvde@…, 19 years ago

I checked this by using SetEnv http_proxy in the Apache conf and all works fine!
There is also an option in curl to exclude certain domains if needed.

For my use this would be enough. I can't think of any situation in which you
want per layer proxy url's.

comment:17 by jcampanello@…, 18 years ago

Cc: jcampanello@… added

comment:18 by elromero@…, 18 years ago

op_sys: LinuxWindows XP
Hello,

I'm a new MapServer user and I have a problem. I want to call a layer from a 
remote WMS but I can't because I have a problem whith the proxy.
I have inserted the next line in httpd.conf file:
SetEnv http_proxy "http://isas.vivienda.local:8080"

And I have inserted in my map file:
LAYER # MODIS WMS map from JPL
    NAME         modis_jpl
    TYPE         RASTER
    OFFSITE      0 0 0
    STATUS       OFF
    CONNECTIONTYPE WMS
    DEBUG        ON
    CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
    
    METADATA
      "wms_srs" "EPSG:4326"
      "wms_name" "modis"
      "wms_server_version" "1.1.1"
      "wms_format" "image/jpeg"      
      "wms_proxy_*" "isas.vivienda.local:8080"
    END

    PROJECTION
      "init=epsg:4326"
    END
  END # Modis WMS image ends here

But I only get a temporary file with an autentification proxy problem.

What am I doing bad? What more do I need?

Thak you,

Emilio

comment:19 by dmorissette, 18 years ago

Emilio, this is a bug report, it is not the place to ask for support, I would
suggest that you send your question to the mapserver-users list. If it turns out
that better proxy support would solve your problem then the conclusions of the
list discussion can be added in support to this bug later on.
(Hint: also include a copy of the proxy error messages in your post to the list.)

comment:20 by dmorissette, 16 years ago

Description: modified (diff)
Milestone: FUTURE5.2 release

by project10, 16 years ago

Initial implementation

Note: See TracTickets for help on using tickets.