mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
support authorization for reseed proxy
This commit is contained in:
parent
f5af059ef4
commit
6555ae5b0a
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue