$host = extractHostnameFromUrl($baseUrl);
// Generate HEAD request header
- $request = 'HEAD ' . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
+ $request = 'HEAD ' . (isProxyUsed() === true ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
$host = extractHostnameFromUrl($baseUrl);
// Generate GET request header
- $request = 'GET ' . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
+ $request = 'GET ' . (isProxyUsed() === true ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
$body = http_build_query($requestData, '', '&');
// Generate POST request header
- $request = 'POST ' . trim($baseUrl) . ' HTTP/1.0' . getConfig('HTTP_EOL');
+ $request = 'POST ' . (isProxyUsed() === true ? $baseUrl : '') . trim($baseUrl) . ' HTTP/1.0' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
// Generate CONNECT request header
$proxyTunnel = 'CONNECT ' . $host . ':' . $port . ' HTTP/1.0' . getConfig('HTTP_EOL');
- $proxyTunnel .= 'Host: ' . $proxyHost . getConfig('HTTP_EOL');
+ $proxyTunnel .= 'Host: ' . $host . getConfig('HTTP_EOL');
+ $proxyTunnel .= 'Proxy-Connection: Keep-Alive' . getConfig('HTTP_EOL');
// Use login data to proxy? (username at least!)
if (getProxyUsername() != '') {
// Read the first line
$resp = trim(fgets($resource, 10240));
$respArray = explode(' ', $resp);
- if ((strtolower($respArray[0]) !== 'http/1.0') || ($respArray[1] != '200')) {
+ if (((strtolower($respArray[0]) !== 'http/1.0') && (strtolower($respArray[0]) !== 'http/1.1')) || ($respArray[1] != '200')) {
// Invalid response!
return $response;
} // END - if