Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » HTTP Basic Proxy auth
icon1.gif  HTTP Basic Proxy auth [message #14006] Wed, 06 February 2008 00:08 Go to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
HTTPClient class does not implement HTTP proxy authentication.

httpcli.h:
class HttpClient
{
public:
...
HttpClient&  ProxyAuth(const char * User, const char * Password)
  { proxy_user = User; proxy_password = Password; return *this; }

String       proxy_user;
String       proxy_password;
...
};

httpcli.cpp:

String HttpClient::Execute(Gate2<int, int> progress)
{
... if(std_headers) { ...

if(use_proxy && !proxy_user.IsEmpty())
{
  request << "Proxy-Authorization: Basic "
    << Base64Encode(proxy_user + ':' + proxy_password)
    << "\r\n";
}
...}...
}


Futher, HttpClient::Proxy(const char *p) can also be modified for support http://user:password@proxy:port notation.
Under WIN32 NTLM authentication can be done, if needed.
Re: HTTP Basic Proxy auth [message #14092 is a reply to message #14006] Sun, 10 February 2008 22:14 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Shire wrote on Tue, 05 February 2008 18:08

HTTPClient class does not implement HTTP proxy authentication.

httpcli.h:
class HttpClient
{
public:
...
HttpClient&  ProxyAuth(const char * User, const char * Password)
  { proxy_user = User; proxy_password = Password; return *this; }

String       proxy_user;
String       proxy_password;
...
};

httpcli.cpp:

String HttpClient::Execute(Gate2<int, int> progress)
{
... if(std_headers) { ...

if(use_proxy && !proxy_user.IsEmpty())
{
  request << "Proxy-Authorization: Basic "
    << Base64Encode(proxy_user + ':' + proxy_password)
    << "\r\n";
}
...}...
}


Futher, HttpClient::Proxy(const char *p) can also be modified for support http://user:password@proxy:port notation.
Under WIN32 NTLM authentication can be done, if needed.


Thank you, applied.

Mirek
Previous Topic: Socket IsError() method use
Next Topic: Distant file info
Goto Forum:
  


Current Time: Thu Mar 28 09:51:43 CET 2024

Total time taken to generate the page: 0.00979 seconds