简体   繁体   中英

CORS using sockets against Azure Blob Storage

I've worked around this but it's an interesting issue.

So using Unity and Unity Web Player (I know WebGL blah blah but it isn't baked yet and doesn't support everything we need) we are streaming video directly from Azure Blob storage.

Now the built in class WWW is a non-starter since it doesn't stream and some of these vids are fairly large. So we used a plugin and a class MovieStreamer to stream the vids. The plugin uses sockets directly but through Unity's version of mono. The sockets require a cross domain policy be available on the flash port for CORS (873 using a non-http protocol).

I had thought that setting the CORS policy on the storage server would enable this. Since the HTTP(s) CORS policy can be set by placing a crossdomain.xml in the $root and making it publicly accessible the CORS policy through API seems redundant. However, it just doesn't work. Even with all "*"s I see the same error for a missing cross domain policy even with the http crossdomain file and settings through the API.

What I did was hack things to use another streaming HTTP plugin and like magic that works since it does in fact use the crossdomain.xml. So without settings changed in AZURE socket CORS is a no go but BestHTTP works fine as does WWW.

So the questions are: What support does Azure storage have for CORS. Is the policy API supposed to enable the flash route? What is the precedence between the two flows?

Keep in mind we aren't using flash it's just that the socket route piggy backs on the flash protocol.

代码示例可能会有所帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM