mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
jump service
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include "NetDb.h"
|
||||
#include "HTTPProxy.h"
|
||||
|
||||
namespace i2p
|
||||
@@ -63,6 +64,19 @@ namespace proxy
|
||||
request r;
|
||||
ExtractRequest(r);
|
||||
parseHeaders(m_Buffer, r.headers);
|
||||
size_t addressHelperPos = r.uri.find ("i2paddresshelper");
|
||||
if (addressHelperPos != std::string::npos)
|
||||
{
|
||||
// jump service
|
||||
size_t addressPos = r.uri.find ("=", addressHelperPos);
|
||||
if (addressPos != std::string::npos)
|
||||
{
|
||||
LogPrint ("Jump service for ", r.host, " found. Inserting to address book");
|
||||
auto base64 = r.uri.substr (addressPos + 1);
|
||||
i2p::data::netdb.InsertAddress (r.host, base64);
|
||||
}
|
||||
}
|
||||
|
||||
LogPrint("Requesting ", r.host, " with path ", r.uri, " and method ", r.method);
|
||||
SendToAddress (r.host, m_Buffer, m_BufferLen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user