From 6555ae5b0a67805fec26a8b240c6095f038d6d77 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 11 Mar 2021 17:02:56 -0500 Subject: [PATCH] support authorization for reseed proxy --- libi2pd/Reseed.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libi2pd/Reseed.cpp b/libi2pd/Reseed.cpp index 2e453b00..a712975e 100644 --- a/libi2pd/Reseed.cpp +++ b/libi2pd/Reseed.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013-2020, The PurpleI2P Project +* Copyright (c) 2013-2021, The PurpleI2P Project * * This file is part of Purple i2pd project and licensed under BSD3 * @@ -574,9 +574,11 @@ namespace data proxyReq.method = "CONNECT"; proxyReq.version = "HTTP/1.1"; proxyReq.uri = url.host + ":" + std::to_string(url.port); + auto auth = i2p::http::CreateBasicAuthorizationString (proxyUrl.user, proxyUrl.pass); + if (!auth.empty ()) + proxyReq.AddHeader("Proxy-Authorization", auth); boost::asio::streambuf writebuf, readbuf; - std::ostream out(&writebuf); out << proxyReq.to_string();