WebMapServiceImageryProvider proxy parameter problem

I am trying to set a proxy per the docs at https://cesiumjs.org/Cesium/Build/Documentation/WebMapServiceImageryProvider.html

var provider = new Cesium.WebMapServiceImageryProvider({
    url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
    layers : '0',
    proxy: new Cesium.DefaultProxy('/proxy/')


However, it doesn’t look like the proxy object ever gets set anywhere. Was proxy taken out of the Resource (below) or am I just doing something wrong? We are on Cesium 1.58. Thanks!


I should have read the changelogs.  Answering my own question...I needed to do this:

var myResource = new Cesium.Resource( {"url":layerUrl, "proxy":new Cesium.DefaultProxy('/proxy')} );
var provider = new Cesium.WebMapServiceImageryProvider({ "url" : myResource, "layers" : '0' });

Thanks for posting your solution Ashley! I’m sure whoever stumbles upon this same issue will appreciate it.

I tried your solution, but I am getting a 404 error. Any help will be appreciated.

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var layerUrl = ‘https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer’;

var myResource = new Cesium.Resource( {“url”:layerUrl, “proxy”:new Cesium.DefaultProxy(’/proxy’)} );

var provider = new Cesium.WebMapServiceImageryProvider({ “url” : myResource, “layers” : ‘0’ });