レスポンスのbodyを以下のようなコードで取得する場合
index.php
list($header, $body) = split("(\r\n){2}", $resp);
PROXYを通すとヘッダーに
HTTP/1.0 200 Connection established
がついてしまい、上手く取得できない。
- 対処法
以下を追加する
index.php
if (false !== stripos($resp, "HTTP/1.0 200 Connection established\r\n\r\n")) {
$resp= str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $resp);
}