*** Search.pm.orig	Sat Jun 23 11:33:50 2001
--- Search.pm	Sat Jun 23 11:47:57 2001
***************
*** 134,139 ****
--- 134,141 ----
                      agent_name => $default_agent_name,
                      agent_e_mail => $default_agent_e_mail,
                      http_proxy => undef,
+                     http_proxy_user => undef,  
+                     http_proxy_pwd => undef,                      
                      timeout => 60,
                      debug => 0,
                      search_from_file => undef,
***************
*** 400,405 ****
--- 402,453 ----
  sub http_proxy { return shift->_elem('http_proxy', @_); }
  
  
+ =head2 http_proxy_user, http_proxy_pwd
+ 
+ Set/get HTTP proxy authentication data.
+ 
+ These routines set/get username and password used in proxy authentication.
+ Authentication is performed only if proxy, username and password 
+ are available.
+ 
+ Example:
+ 
+     $search->http_proxy_user("myuser");
+     $search->http_proxy_pwd("mypassword");
+     $search->http_proxy_user(undef);        #No authentication
+     
+     $username = $search->http_proxy_user();
+ 
+ =cut
+ 
+ sub http_proxy_user {
+     my $obj = shift;
+     @_ ? $obj->{http_proxy_user} = shift            
+        : $obj->{http_proxy_user};                   
+ }
+ 
+ sub http_proxy_pwd {
+     my $obj = shift;
+     @_ ? $obj->{http_proxy_pwd} = shift            
+        : $obj->{http_proxy_pwd};                   
+ }
+ 
+ 
+ =head2 is_http_proxy_auth_data (PRIVATE)
+ 
+ Checks if authentication data (proxy name, username and password) are available.
+ In this case proxy authentication is performed.
+ 
+ =cut
+ 
+ sub is_http_proxy_auth_data { 
+ 	$self = shift;
+ 	return defined($self->http_proxy()) and 
+ 		defined($self->http_proxy_user()) and 
+ 		defined($self->http_proxy_pwd());
+ }
+ 
+ 
  =head2 approximate_result_count
  
  Some backends indicate how many hits they have found.
***************
*** 837,842 ****
--- 885,895 ----
        {
        $request = new HTTP::Request($method, $url);
        }
+ 
+ 	if ($self->is_http_proxy_auth_data()) {
+     	$request->proxy_authorization_basic($self->http_proxy_user(), 
+     		$self->http_proxy_pwd());
+     }
  
      $self->{'_cookie_jar'}->add_cookie_header($request) if ref($self->{'_cookie_jar'});
      # print STDERR " + the request with cookies is >>>", $request->as_string, "<<<\n";
