I'm developing an application using the ArcGIS Javascript API and everything has been working fine until I've tried to incorporate the print widget using printtask. When only the base layers are accessed in the code, the map is printed just fine. But when I include any layer running on my local instance of ArcGIS Server 10.2 (dynamic or feature layers) the print operation fails. I assume this is because I need a "proxy" file although I thought I read it's possible to utilize CORS. I'm using the latest FireFox browser, ArcGIS Server 10.2 and I have configured my code to include:
esri.config.defaults.io.corsEnabledServers.push("10.111.123.234:6080");
esri.config.defaults.io.corsEnabledServers.push("sampleserver1a.arcgisonline.com");
esri.config.defaults.io.corsEnabledServers.push("sampleserver6.arcgisonline.com");
esri.config.defaults.io.corsEnabledServers.push("tasks.arcgisonline.com");
esri.config.defaults.io.corsEnabledServers.push("server.arcgisonline.com");
The IP address above is my local PC pointing to the ArcGIS Server port of my services. I have tried just localhost:6080 as well.
Either way, the printing functionality still fails so I'm not sure if CORS is valid for this operation and that I have to use a proxy file anyway?