现在的位置: 首页 > 综合 > 正文

opengl insights:4 webgl for opengl developers

2018年05月27日 ⁄ 综合 ⁄ 共 631字 ⁄ 字号 评论关闭

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 *

抱歉!评论已关闭.