Same-origin policy, cross origin resource sharing and proxies...

Hello Cesium developers and users!

I've been enjoying using and working with Cesium as a way to further my web development and JavaScript work. Thanks for what you guys are doing, Cesium is awesome!

I've run into a snag though.. I've been assigned the job of adding TomTom map tile layer to the globe. They offers the tiles in the WMS format (if that's what that's called), so I can use WebMapServiceImageryProvider to add the tiles to the map. However, TomTom hasn't enabled Cross-origin Resource Sharing.

Therefore, I'm getting Same-Origin Policy errors from the browser when I try to add these tiles.

I know, there are posts here in the forum about fixing this issue with a proxy. However, we are using a Weblogic server and I'm not familiar enough with Jetty to know how to translate Cesium's DefaultProxy implementation to any sort of Weblogic proxy (which I also don't know how to do..).

My questions are:

1. Can anybody on here give a more in depth explanation of the proxy implemented for Cesium?

2. Is there any other way around this same-origin policy?
I've tried writing a spring request for the backend to load images and pass back to the front end, but I'm having proxy issues there as well. (Yay internet!)

3. Has anybody implemented a proxy for Weblogic?

Thank you all very much in advance!


I don’t know anything about WebLogic so I can’t help you there, but the proxy Cesium needs is really simple.

It listens for requests on a URL like:

And it makes a request to [url] and returns the response. So, for example, Cesium requests:

Your proxy service makes its own request to:

And when it receives a response from that server it returns the response to the Cesium client.