AsyncTcpConnection类如何设置代理IP

zhqing

问题描述

这里写问题具体描述

505 1 0
1个回答

北月
  • zhqing 2023-05-24

    如何设置代理ip的帐号和密码呢

  • zhqing 2023-05-24

    'http' => array(
    'proxy' => 'tcp://192.168.0.2:3128', //这里设置你要使用的代理ip及端口号
    'request_fulluri' => true,
    'header' => "Proxy-Authorization: Basic $auth",
    ),
    想这样使用代理ip

  • zhqing 2023-05-24

    $client = new AsyncTcpConnection('ws://0.0.0.0:2566');
    $client->headers = [
    'http' => [
    'request_fulluri' => true,
    'proxy' => 'ip:port',
    'header' => [
    'Proxy-Switch-Ip' => 'yes',
    'Proxy-Authorization' => 'Basic ' . base64_encode('user:pass')
    ],
    ]
    ];
    这样使用代理ip无效,请教下怎样设置

🔝