mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
jump service
This commit is contained in:
parent
f30a466bec
commit
e51cca8263
4 changed files with 24 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue