crx349 发表于 2019-1-15 18:14:32

Workerman websocket js调用跨域配置


onMessage函数内添加

\Workerman\Protocols\Http::header('Access-Control-Allow-Origin: *');
       \Workerman\Protocols\Http::header('Access-Control-Allow-Headers: *');
       \Workerman\Protocols\Http::header('Access-Control-Allow-Methods: GET, POST, PUT,OPTIONS');
页: [1]
查看完整版本: Workerman websocket js调用跨域配置