2) I haven't played around with CORS yet, I only know that it must be enabled on the web-server with a whitelist of allowed origin domains, may be the web server configuration you're sending the request to has changed in the past 2.5 yrs? (see here for a lot of detailed information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
3/4) AFAIK you can use the full URL for emscripten get_data/fetch requests, I only cut the host address part off in my own code so that the code works without changes from any domain (e.g. localhost vs github pages) Cheers and good luck :) -Floh. Am Donnerstag, 25. Mai 2017 20:28:21 UTC+2 schrieb Erik Veselý: > > Hah, I knew that the anwser will come immediately :) Thank you > > So, the thing is: > > 1] I haven't know about the browser dev tools and it tells me exactly what > you have mentioned - there's a cross origin request > 2] The CORS is my problem ... but I haven't found a word about it anywhere > ... the trick is, that cca 2,5 years ago, when I started to play with > emscripten, the full URL was working. Suddenly, like 2 years ago, it > stopped streaming, so I suppose that the CORS specific policy got > introduced in that time , or so ? I was still in the situation that I > believed it should normally work since it worked in the past :) > 3] What is really interesting for me is the fact, that I am using full > URL, but in fact, that URL is the same as the location where original > index.html with emscripten is located. So does it mean that you can't even > mention full URL and it will become Cross-origin request otherwise ? > 4] The emscripten codebase test file: tests/HTTP.cpp is using also full > URL and that was the thing which bothered me the most, that I am doing it > as I should. > > Anyway, I am really happy that it's working when I use local path , > because there was no real reason why it shouldn't. The real question is, if > I missed the documentation in this sense, or if it should be updated ? And > also, is the full URL cross-origin request planned for the future ? > > Thanks again for your help, I love the idea behind Emscripten and I am > grateful that it works as it does. > Great job guys ! > > Dne čtvrtek 25. května 2017 17:56:57 UTC+2 Floh napsal(a): >> >> If you need a very simple example to verify your code you can have a look >> here: >> >> >> https://github.com/floooh/oryol/blob/master/code/Modules/HttpFS/private/emsc/emscURLLoader.cc >> >> I'm ignoring the entire host-address part of the URL, and only give it >> the path component, since loading from another domain isn't allowed anyway >> (or rather: I don't care yet about CORS: >> https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS). >> >> What sort of error are you getting? Did you check what the networking tab >> in the browser dev tools says about your request? >> >> -Floh >> >> Am Donnerstag, 25. Mai 2017 14:49:33 UTC+2 schrieb Erik Veselý: >>> >>> Hi, >>> >>> After spending few days on making http async file download working via >>> async_wget family functions, I have just decided to write here, since there >>> must be something wrong :( Hopefully it's easy and I have overlooked >>> something, so I am really sorry for bothering in that case :) >>> >>> I had it working like two years ago, and I can remember that one day it >>> got broken for me, now, after those 2 years, I have tried all the versions, >>> with file system write, with data pointer, and even the 2 version with >>> custom params and detail error informations. I won't go further into >>> details, because I've tried tests/http.cpp in your codebase with the >>> Emscripten official latest installation in Visual Studio, and it gives me >>> completely the same issue. Once the async load is called, OnError() is >>> triggered immediately with error code 0 and no error message. >>> >>> I've tried different browsers, different machines and searched the whole >>> internet, but noone really had even a similar issue, but it's working >>> everywhere so I must be definitelly doing something terribly wrong. >>> >>> Thank you very much in advance >>> Erik >>> >>> -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
