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.