summaryrefslogtreecommitdiff
path: root/methods/http.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-06-30 13:24:04 +0200
committerJulian Andres Klode <jak@debian.org>2017-06-30 15:00:41 +0200
commit64207dad49f1c803d2b004ccf8fc6432789a8cc2 (patch)
tree944a454e0396f200597c9b4222dca089fcec786d /methods/http.h
parent4b1d19fe5619ef46c952ca84531759a981741482 (diff)
http: Add support for CONNECT proxying to HTTPS locations
Proxying HTTPS traffic requires the proxy providing the CONNECT method. This implements the client side of it, although it is a bit hacky. HTTP connect is a normal HTTP CONNECT request, followed by a normal HTTP response, just that the body of the response is the TCP stream of the target host. We use a special wrapper in case there are data bytes in the header packets - in that case, the bytes are stored in a buffer and the buffer will be drained first, afterwards the connection continues directly with the TCP stream (with one more vcall). Also: Do not send full URI to https destinations when proxying, as we are directly interfacing with the destination data stream.
Diffstat (limited to 'methods/http.h')
-rw-r--r--methods/http.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/methods/http.h b/methods/http.h
index 3336fb780..7a763675c 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -73,6 +73,7 @@ class CircleBuf
// Write data out
bool Write(std::unique_ptr<MethodFd> const &Fd);
+ bool Write(std::string &Data);
bool WriteTillEl(std::string &Data,bool Single = false);
// Control the write limit
@@ -92,6 +93,8 @@ class CircleBuf
~CircleBuf();
};
+bool UnwrapHTTPConnect(std::string To, int Port, URI Proxy, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
+
struct HttpServerState: public ServerState
{
// This is the connection itself. Output is data FROM the server