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]