[drupal-devel] [feature] RSS Feeds behind Firewall

jhefmv24 drupal-devel at drupal.org
Mon Feb 7 06:48:00 UTC 2005


 Project:      Drupal
 Version:      4.5.2
 Component:    base system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  jhefmv24
 Updated by:   jhefmv24
-Status:       active
+Status:       patch
 Attachment:   http://drupal.org/files/issues/common.inc_7.patch (1.38 KB)

compliant patch for proxy suport, thanks Steven.


jhefmv24



Previous comments:
------------------------------------------------------------------------

May 19, 2004 - 13:01 : jhefmv24

Attachment: http://drupal.org/files/issues/common.inc (37.11 KB)

I think the RSS feeds don't work if there is proxy server running. The
request/connection is somehow being blocked. 
The connection should be made first to the proxy and once it is
established, then request can made.
I think the core function drupal_http_request() under
/includes/common.inc doesn't support this.
One workaround is change the code from:

<?php
switch ($uri['scheme']) {
  case 'http':
     //$fp = @fsockopen($uri['host'], ($uri['port'] ? $uri['port']
: 80), $errno, $errstr, 15);
?>


into:

<?php
//use proxy settings
    $fp = @fsockopen('proxy2', '8080');
?>


And then create the request by change from:

<?php
$request = "$method $path HTTP/1.0\r\n";
?>


Into:

<?php
$request = "$method ".$uri['scheme']."://".$uri['host'].$path."
HTTP/1.1\r\n";
?>


And comment out the lines:

<?php
$request .= implode("\r\n", $defaults);
?>




------------------------------------------------------------------------

February 2, 2005 - 07:38 : Anonymous

Did this ever get taken care of in 4.5.2. I can't seem to get any feed
to work from behind a firewall. Getting error....
Failed to parse RSS feed Microsoft Security Info: 10060 A connection
attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because
connected host has failed to respond..
At home this same feed works fine, so I know it's not the feed.
Thanks,
SlackNet


------------------------------------------------------------------------

February 4, 2005 - 12:24 : jhefmv24

Attachment: http://drupal.org/files/issues/common.inc_4.patch (1.37 KB)

+1 on having a facility to modify proxy settings...
here's a patch of /includes/common.inc for drupal-4.4.2 version


------------------------------------------------------------------------

February 4, 2005 - 12:25 : jhefmv24

Attachment: http://drupal.org/files/issues/system.module_2.patch (956 bytes)

+1 on having a facility to modify proxy settings...
here's a patch of /modules/system.module for drupal-4.4.2 version


------------------------------------------------------------------------

February 4, 2005 - 12:31 : jhefmv24

Attachment: http://drupal.org/files/issues/common.inc_5.patch (1.35 KB)

patch for /includes/common.inc 4.5.2 version to facilitate rss feeds
behind firewall


------------------------------------------------------------------------

February 4, 2005 - 12:32 : jhefmv24

Attachment: http://drupal.org/files/issues/system.module_3.patch (1.03 KB)

patch of /modules/system.module 4.5.2 version to set proxy settings


------------------------------------------------------------------------

February 4, 2005 - 16:23 : Bèr Kessels

hi, tso small issues. one is described at: http://drupal.org/node/9706
The other is that the code is not "drupal compliant". Drupal developrs
are (luckily) very picky about spaces, indentation, etc.


------------------------------------------------------------------------

February 4, 2005 - 16:51 : jhefmv24

Attachment: http://drupal.org/files/issues/common.inc_6.patch (1.37 KB)

i forgot to remove my hardcoded proxy name.. sorry
Ber, which is not drupal compliant?


------------------------------------------------------------------------

February 5, 2005 - 05:22 : Anonymous

Is there any way to hardcode my proxy server name? I can't seem to get
the patches to work. I just get a blank page after I try to update the
news feeds.


------------------------------------------------------------------------

February 5, 2005 - 06:51 : Anonymous

Here's the error I get...
warning: fsockopen(): unable to connect to :8080 in
....\includes\common.inc on line 228.


------------------------------------------------------------------------

February 5, 2005 - 15:09 : Steven

1) New features only get added to CVS/HEAD, not to the 4.5.x branch.
2) 'Blind' variables that cannot be changed through an admin interface
are not a good idea.
3) Your proxy codepath ignores the $defaults array completely. At this
point in the code, this doesn't just contain default headers but also
any extra headers passed to drupal_http_request(). This is not good as
they are simply not used anymore.
4) Code style:
//use proxy settings
There should be a space between '//' and text. MInd capitalization and
punctuation.
$request = "$method ".$uri['scheme']."://".$uri['host'].$path."
HTTP/1.1\r\n";
Rules for string concatenation: never a space between . and a quote,
always a space otherwise.
Tab usage: we never use tabs due to editor differences. Your patch
contains several.
String quote usage: we prefer single quotes in Drupal to double quotes,
except in the case where single quotes would be too hard to read (e.g.
backslash escapes should be avoided as well).


------------------------------------------------------------------------

February 5, 2005 - 22:05 : Anonymous

In a very tight setup, users must authenticate to access the proxy, to
prevent unauthorised usage, or to track authorised usage.
Can the proxy support also be modified to allow username/password to be
supplied to the proxy?


------------------------------------------------------------------------

February 7, 2005 - 14:46 : jhefmv24

Attachment: http://drupal.org/files/issues/system.module_4.patch (1.01 KB)

Thanks Steven.
I hope this patch works and be accepted...  This will allow proxy
variables to be modified using the admin interface.


-- 
View: http://drupal.org/node/7881
Edit: http://drupal.org/project/comments/add/7881





More information about the drupal-devel mailing list