- Home /
Unity + Cors in WebGL
Hello!
I'm downloading images from the web with www.texture. This works fine in my PC build, but moving to webGL I get the famous error that cors is not enabled.
I see that those headers need to be sent by the server for this to work properly. Is there any way around this if I don't have access to the server? I found links for a loose guide for creating a proxy that downloads the images and sends out the proper cors headers. Just wanted to see if there is a better way to to this.
Thanks!
Jed
Answer by Baumkuchen · Nov 06, 2018 at 12:10 AM
Note that WWW.responseHeaders is limited to a subset of the actual response headers, according to 7.1.1 of the CORS specification.
Also note that XMLHttpRequest does not allow streaming of data, thus the WWW class on WebGL will only process any data once the download has finished (so AssestBundles cannot be decompressed and loaded while downloading as on other platforms).
Your answer
Follow this Question
Related Questions
load URL images in Webgl. 1 Answer
Cant load texture by WWW in WebGL 0 Answers
Downloading an image via WebGL 0 Answers
Texture is not loading using WWW class in WebGL build. 0 Answers
When Unity3D finally supports WebGL? 2 Answers