Add HTTP proxy support.
* Move default context management to BUrlRequest since some code (including the testsuite) bypass the BUrlProtocolRoster. * Introduce proxy host and port in BUrlContext * Have BHttpRequest use the proxy when making requests
This commit is contained in:
@@ -26,7 +26,7 @@ public:
|
||||
virtual status_t Stop();
|
||||
|
||||
protected:
|
||||
bool _ResolveHostName(uint16_t port);
|
||||
bool _ResolveHostName(BString host, uint16_t port);
|
||||
|
||||
void _ProtocolSetup();
|
||||
status_t _GetLine(BString& destString);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* Copyright 2010-2014 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _B_URL_CONTEXT_H_
|
||||
#define _B_URL_CONTEXT_H_
|
||||
|
||||
@@ -27,16 +29,24 @@ public:
|
||||
const BNetworkCookieJar& cookieJar);
|
||||
void AddAuthentication(const BUrl& url,
|
||||
const BHttpAuthentication& authentication);
|
||||
|
||||
void SetProxy(BString host, uint16 port);
|
||||
|
||||
// Context accessors
|
||||
BNetworkCookieJar& GetCookieJar();
|
||||
BHttpAuthentication& GetAuthentication(const BUrl& url);
|
||||
bool UseProxy();
|
||||
BString GetProxyHost();
|
||||
uint16 GetProxyPort();
|
||||
|
||||
private:
|
||||
BNetworkCookieJar fCookieJar;
|
||||
typedef BPrivate::SynchronizedHashMap<BPrivate::HashString,
|
||||
BHttpAuthentication*> BHttpAuthenticationMap;
|
||||
BHttpAuthenticationMap* fAuthenticationMap;
|
||||
|
||||
BString fProxyHost;
|
||||
uint16 fProxyPort;
|
||||
};
|
||||
|
||||
|
||||
#endif // _B_URL_CONTEXT_H_
|
||||
|
||||
Reference in New Issue
Block a user