opengl insights:4 webgl for opengl developers

来源:互联网 发布:淘宝天猫店招尺寸 编辑:程序博客网 时间:2024/05/17 22:49

1。跨域

代理服务器

img.src = "proxy.phy?anotherDomain.com/img.png


CORS

cross-origin resource sharing.see http://enable-cors.org/

In PHP

If you don't have access to configure Apache, you can still send the header from a PHP script. It's a case of adding the following to your PHP scripts:

 <?php header("Access-Control-Allow-Origin: *");

For Apache

Apache can be configured to expose this header using mod_headers, this is enabled by default in Apache however you may want to ensure it's enabled by running the following command:

a2enmod headers

To expose the header you simply add the following line inside <Directory><Location><Files> or <VirtualHost>sections, or within a .htaccess file:

Header set Access-Control-Allow-Origin *

原创粉丝点击