workerman作为ws客户端,如何设置额外的header?

顾涛

$header = "Cookie: cId=26628661780583\r\n";
$header .= "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36\r\n";

$option = ;

$con = new AsyncTcpConnection('ws://www.test.com:9000/socket.io', $option);

这样设置没有效果,请问应该如何设置?

5621 2 1
2个回答

wenken

$header = ;

$option = ;

$con = new AsyncTcpConnection('ws://www.test.com:9000/socket.io', $option);这样试试!

  • 顾涛 2019-03-12

    试过了,没有效果。。。

顾涛
  • 暂无评论
年代过于久远,无法发表回答
🔝