Cesium proxy

1,022 views
Skip to first unread message

adam.d...@gmail.com

unread,
Sep 4, 2013, 11:50:59 AM9/4/13
to cesiu...@googlegroups.com
I am trying to request WMS layers to display onto my globe which have been getting blocked due to CORS. I am trying to set up the cesium default proxy but am struggling to find much documentation on how this is achieved. Could somebody guide me through how to set this proxy up so that I don't have to enable CORS please?

Matthew Amato

unread,
Sep 4, 2013, 11:58:43 AM9/4/13
to cesiu...@googlegroups.com
If you're using the Cesium development web-server (i.e. running `ant runServer`), you can either modify build.xml and modify `runServer.allowedHosts` to include your site (or simply change the value to `*`.

You can also pass `runServer.allowedHosts` on the command line for example

`ant runServer -DrunServer.allowedHosts="*"`


On Wed, Sep 4, 2013 at 11:50 AM, <adam.d...@gmail.com> wrote:
I am trying to request WMS layers to display onto my globe which have been getting blocked due to CORS. I am trying to set up the cesium default proxy but am struggling to find much documentation on how this is achieved. Could somebody guide me through how to set this proxy up so that I don't have to enable CORS please?

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

adam.d...@gmail.com

unread,
Sep 4, 2013, 4:01:19 PM9/4/13
to cesiu...@googlegroups.com, adam.d...@gmail.com
On Wednesday, September 4, 2013 4:50:59 PM UTC+1, adam.d...@gmail.com wrote:
> I am trying to request WMS layers to display onto my globe which have been getting blocked due to CORS. I am trying to set up the cesium default proxy but am struggling to find much documentation on how this is achieved. Could somebody guide me through how to set this proxy up so that I don't have to enable CORS please?

So are you saying that I have to be running on the dev web-server to use the DefaultProxy? Or is it possible to use running on other servers?

Matthew Amato

unread,
Sep 4, 2013, 4:17:17 PM9/4/13
to cesiu...@googlegroups.com
If you are using your own proxy, you need to pass the url of the proxy to the DefaultProxy constructor.  This assumes your proxy works by taking a single query parameter which is the url of the resource to retrieve.  Otherwise you need to implement your own proxy object, which is simply an object with a function named `getURL` that takes the url of the resource to retrieve.  Keep in mind that DefaultProxy is an incredibly simple object that just calls through to a proxy server.

If this doesn't answer all of your questions, tell us a little bit more about your set up and we'll try and point you in the right direction.


adam.d...@gmail.com

unread,
Sep 5, 2013, 5:14:31 AM9/5/13
to cesiu...@googlegroups.com
I have managed to get it working running on the ant server. Thank you for your help. I think that this should be made clearer in the tutorials to benefit others because I struggled to find any information on how to achieve this.
Reply all
Reply to author
Forward
0 new messages