Revert "Add support to sync via http proxy"
This reverts commit c5f6f41612
.
This commit is contained in:
parent
c5f6f41612
commit
673ceec47e
|
@ -98,15 +98,11 @@ function nntp2_open($nserver=0,$nport=0) {
|
|||
} else {
|
||||
if(isset($CONFIG['socks_host']) && $CONFIG['socks_host'] !== '') {
|
||||
$ns=fsocks4asockopen($CONFIG['socks_host'], $CONFIG['socks_port'], $nserver, $nport);
|
||||
} elseif(isset($CONFIG['http_host']) && $CONFIG['http_host'] !== '') {
|
||||
$ns=fhttpsockopen($CONFIG['http_host'], $CONFIG['http_port'], $nserver, $nport);
|
||||
} else {
|
||||
$ns=@fsockopen('tcp://'.$nserver.":".$nport);
|
||||
}
|
||||
}
|
||||
if(isset($CONFIG['http_host']) && $CONFIG['http_host'] !== '') {
|
||||
fputs($ns, "MODE reader\r\n");
|
||||
}
|
||||
// $ns=@fsockopen($nserver,$nport);
|
||||
$weg=line_read($ns); // kill the first line
|
||||
if (substr($weg,0,2) != "20") {
|
||||
echo "<p>".$text_error["error:"].$weg."</p>";
|
||||
|
@ -151,27 +147,11 @@ function fsocks4asockopen($proxyHostname, $proxyPort, $targetHostname, $targetPo
|
|||
if($values["ret"] == 0x5a) return $sock;
|
||||
else
|
||||
{
|
||||
fclose($sock);
|
||||
fclose(sock);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function fhttpsockopen($proxyHostname, $proxyPort, $targetHostname, $targetPort)
|
||||
{
|
||||
$sock = fsockopen($proxyHostname, $proxyPort);
|
||||
if($sock === false)
|
||||
return false;
|
||||
fwrite($sock, 'CONNECT '.$targetHostname.':'.$targetPort.' HTTP/1.0');
|
||||
fwrite($sock, "\r\n");
|
||||
fwrite($sock, "\r\n");
|
||||
$weg=line_read($sock);
|
||||
while (substr($weg,0,2) != "20") {
|
||||
echo $weg."\r\n";
|
||||
$weg=line_read($sock);
|
||||
}
|
||||
return $sock;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close a NNTP connection
|
||||
*
|
||||
|
|
|
@ -5,8 +5,6 @@ return [
|
|||
'remote_ssl' => '',
|
||||
'socks_host' => '',
|
||||
'socks_port' => '',
|
||||
'http_host' => '',
|
||||
'http_port' => '',
|
||||
'remote_auth_user' => 'username',
|
||||
'remote_auth_pass' => 'password',
|
||||
'enable_nntp' => '1',
|
||||
|
|
|
@ -13,8 +13,6 @@ return [
|
|||
'remote_auth_pass' => 'Password to authenticate to remote server',
|
||||
'socks_host' => 'ip address of your socks4a server (use this for tor)',
|
||||
'socks_port' => 'port for your socks4a server',
|
||||
'http_host' => 'ip address of your http proxy server (use this for i2p or create client tunnel)',
|
||||
'http_port' => 'port for your http proxy server',
|
||||
|
||||
# LOCAL server configuration
|
||||
'enable_nntp' => 'Enable local nntp server (1=true, blank=false)',
|
||||
|
|
|
@ -138,6 +138,7 @@ function get_articles($ns, $group) {
|
|||
$banned_names = file("/etc/rslight/banned_names.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
||||
$nocem_check="@@NCM";
|
||||
|
||||
# Check if group exists. Open it if it does
|
||||
fputs($ns, "group ".$group."\r\n");
|
||||
$response = line_read($ns);
|
||||
|
@ -222,10 +223,6 @@ function get_articles($ns, $group) {
|
|||
if (strcmp(substr($response,0,3),"220") != 0) {
|
||||
echo "\n".$response."\n";
|
||||
file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Unexpected response to ARTICLE command: ".$response, FILE_APPEND);
|
||||
if(trim($response) == '') {
|
||||
fclose($ns);
|
||||
break;
|
||||
}
|
||||
$article++;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue