diff --git a/src/reqs.c b/src/reqs.c index 990152a..26158ae 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -267,6 +267,17 @@ establish_http_connection (struct conn_s *connptr, struct request_s *request) "Connection: close\r\n", request->method, request->path, request->host, portbuff); + } else if ((connptr->upstream_proxy) && + (connptr->upstream_proxy->basic_auth)) { + /* Basic auth is set for upstream proxy. */ + return write_message (connptr->server_fd, + "%s %s HTTP/1.0\r\n" + "Host: %s%s\r\n" + "Connection: close\r\n" + "Proxy-Authorization: Basic %s\r\n", + request->method, request->path, + request->host, portbuff, + connptr->upstream_proxy->basic_auth); } else { return write_message (connptr->server_fd, "%s %s HTTP/1.0\r\n"