Add a useProxy option when creating a new Map Service Layer object in JavaScript API.

290
1
07-22-2011 10:00 AM
Status: Open
ClayTinnell
New Contributor III
In addition to having a global esri.config.defaults.io.alwaysUseProxy property, it would be nice to pass a useProxy param in the options object when creating a map service layer (dynamic or tiled) in the JavaScript API. The useProxy value would override the esri.config.defaults.io.alwaysUseProxy value, if defined. If useProxy is set to true, the esri.config.defaults.io.proxyUrl global param would have to be defined.

We are using map services from multiple sources, and we must have all our internal map services going through the proxy, but the external map services must not go through the proxy. We have currently achieved this by creating a custom tiled layer type (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm), but it would be nice if it was part of the API.
1 Comment
SimonLiu
I'd like to second this idea. Selective proxying would make deploying JavaScript apps to firewalled environments MUCH easier. The Flex/Silverlight APIs offer something like this already.

On many occasions, we have wanted to deploy apps to servers in a DMZ, and the machines cannot make outgoing connections to ArcGIS Online / the wider Internet. This makes proxy pages unusable because they try to proxy everything, not just requests to internal services.

It would be really helpful if the "useProxy" attribute could be added to other service types as well, such as feature services, GP services, Network Analysis services, etc.