With ESRI's Javascript API - is it possible to make only certain layers go through the proxy? I know this is possible in the Flex API via proxyUrl property of applicable layers.

Right now i have this code in my initialization function - but all map content is now routed through proxy.

esri.config.defaults.io.proxyUrl = "proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = true;

2 Answers 2


For future reference, v3.4 of the Javascript API added esri.config.defaults.io.proxyRules, which allows you to use the proxy for some services:



I can't find anything in the ArcGIS Javascript API that lets you decide which layers go through a proxy. According to this page, you should set alwaysUseProxy to true if you're dealing with secured services and tokens. If you set it to false, the proxy is not used on local services when the request is less than 2000 characters.

  • 2
    I think Rakeno is right, you have to use the proxy all or nothing. I guess you are using the proxy to authenticate services? If not and its just for transferring complex geometries it might be worth checking out the coors features from V2.5 onwards. blogs.esri.com/esri/arcgis/2011/09/29/… Commented Nov 27, 2012 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.