سؤال

I try to use webgl examples, where there are textures (images and video), so i downloaded examples from internet, but the problem is that i cant use them directly from the browser, because the protocole file:// will be used and not http:// and that block the texture and make an error from javascript console:

Failed to load resource: net::ERR_FILE_NOT_FOUND

So, how do i use ONLY a browser to mimic the internet HTTP protocol?

هل كانت مفيدة؟

المحلول

If you are on a system with Python (e.g. available by default on OS X) switch to the folder you want to serve and use:

python -m SimpleHTTPServer [port]

Then use a browser to open http://localhost:[port]

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top