FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
 FIREWALL / PROXY SETTING View next topic
View previous topic
Post new topicReply to topic
Author Message
Tech Support



Joined: 27 Aug 2004
Posts: 2787

PostPosted: Wed Aug 31, 2005 6:16 am Reply with quoteBack to top

Our next release will support proxy servers. The beta will be available really soon.

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
ninjajim



Joined: 13 Mar 2006
Posts: 1

PostPosted: Mon Mar 13, 2006 2:10 pm Reply with quoteBack to top

I am a newbie to php so apologies if asking silly questions
I am running rss2html on an iis 6 box which is behind a firewall and uses a proxy to access the web.

I need windows authentication for access through the proxy server.

Requests to the php script will be from the internal LAN.

the fopen request from php needs to authenticate through the proxy server.

All works fine if I run on a box that does not need proxy to access the web

Does anybody have any ideas on how to achieve this?
View user's profile
what`a



Joined: 28 Sep 2007
Posts: 4

PostPosted: Fri Sep 28, 2007 4:45 pm Reply with quoteBack to top

I also connect to internet using proxy.
I've made some changes on FeedForAll_XMLParser.inc.php
I added this code

Code:
//----------------------functions for proxy-----------


function need_proxy($url){
  $exeption=array("students.stttelkom.ac.id"); // this will useful for feeds that don't need proxy
  $cnt=0;
  $i=0;
  while($exeption[$i]){
    $subject = $url;
    $pattern = '^'.$exeption[$i].'^';
    $cnt+= preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE);
    $i++;
  }
  if($cnt>=1){
    return false;
  }else{
    return true;
  }
}


function proxy_url($proxy_url)
{
    $proxy_name = '10.14.200.253';
    $proxy_port = 5555;
    $proxy_cont = '';

    $proxy_fp = fsockopen($proxy_name, $proxy_port);
    if (!$proxy_fp)    {return false;}
    fputs($proxy_fp, "GET $proxy_url HTTP/1.0\r\nHost: $proxy_name\r\n\r\n");   
    while(!feof($proxy_fp)) {$proxy_cont .= fread($proxy_fp,4096);}
    fclose($proxy_fp);
    $proxy_cont = substr($proxy_cont, strpos($proxy_cont,"\r\n\r\n")+4);
    return $proxy_cont;
}
//------------------------------------------------------------


And modify this part..

Code:
if ($useFopenURL == 1) {
        if(need_proxy($filename)){
          $result=proxy_url($filename);
         
      }else{
        if (($fd = @fopen($filename, "rb")) === FALSE) {
          if (isset($debugLevel) && ($debugLevel >= 1)) {
            echo "DIAG: FeedForAll_scripts_readFile(): fopen() failed<br>\n";
          }
          return FALSE;
        }
        while (($data = fread($fd, 4096)) != "") {
          $result .= $data;
        }
        fclose($fd);
       
       }
          //echo $filename;
      
      //echo $result;
     }
      elseif ($useFopenURL == -1) {


It works well for me...
View user's profileVisit poster's website
what`a



Joined: 28 Sep 2007
Posts: 4

PostPosted: Fri Sep 28, 2007 4:46 pm Reply with quoteBack to top

And i'm using option

Code:
$useFopenURL = 1;

in index.php
View user's profileVisit poster's website
Tech Support



Joined: 27 Aug 2004
Posts: 2787

PostPosted: Mon Oct 01, 2007 3:55 pm Reply with quoteBack to top

Thanks for that info. If you get a chance, can you post it to the RSS2HTML section of this forum too. I think more people will see it there.

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme