i2pheaders param for HTTP server tunnel
Some checks failed
Build Debian packages / bookworm (push) Has been cancelled
Build Debian packages / bullseye (push) Has been cancelled
Build Debian packages / trixie (push) Has been cancelled
Build on FreeBSD / with UPnP (push) Has been cancelled
Build on OSX / With USE_UPNP=no (push) Has been cancelled
Build on OSX / With USE_UPNP=yes (push) Has been cancelled
Build on Windows / clang-x86_64 (push) Has been cancelled
Build on Windows / i686 (push) Has been cancelled
Build on Windows / ucrt-x86_64 (push) Has been cancelled
Build on Windows / x86_64 (push) Has been cancelled
Build on Windows / CMake clang-x86_64 (push) Has been cancelled
Build on Windows / CMake i686 (push) Has been cancelled
Build on Windows / CMake ucrt-x86_64 (push) Has been cancelled
Build on Windows / CMake x86_64 (push) Has been cancelled
Build on Windows / XP (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=no (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=yes (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=OFF (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=ON (push) Has been cancelled
Build containers / Building container for linux/amd64 (push) Has been cancelled
Build containers / Building container for linux/arm64 (push) Has been cancelled
Build containers / Building container for linux/arm/v7 (push) Has been cancelled
Build containers / Building container for linux/386 (push) Has been cancelled
Build containers / Pushing merged manifest (push) Has been cancelled

This commit is contained in:
orignal 2025-11-02 12:09:06 -05:00
parent cfcd0261c3
commit f94990c870
4 changed files with 14 additions and 7 deletions

View file

@ -765,8 +765,6 @@ namespace client
std::string accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_ACCESS_LIST, ""); std::string accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_ACCESS_LIST, "");
if(accessList == "") if(accessList == "")
accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_WHITE_LIST, ""); accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_WHITE_LIST, "");
std::string hostOverride = section.second.get<std::string> (I2P_SERVER_TUNNEL_HOST_OVERRIDE, "");
std::string webircpass = section.second.get<std::string> (I2P_SERVER_TUNNEL_WEBIRC_PASSWORD, "");
bool gzip = section.second.get (I2P_SERVER_TUNNEL_GZIP, false); bool gzip = section.second.get (I2P_SERVER_TUNNEL_GZIP, false);
i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519); i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519);
#if !OPENSSL_PQ #if !OPENSSL_PQ
@ -851,9 +849,16 @@ namespace client
std::shared_ptr<I2PServerTunnel> serverTunnel; std::shared_ptr<I2PServerTunnel> serverTunnel;
if (type == I2P_TUNNELS_SECTION_TYPE_HTTP) if (type == I2P_TUNNELS_SECTION_TYPE_HTTP)
serverTunnel = std::make_shared<I2PServerTunnelHTTP> (name, host, port, localDestination, hostOverride, inPort, gzip); {
std::string hostOverride = section.second.get<std::string> (I2P_SERVER_TUNNEL_HOST_OVERRIDE, "");
bool i2pheaders = section.second.get (I2P_SERVER_TUNNEL_I2P_HEADERS, true);
serverTunnel = std::make_shared<I2PServerTunnelHTTP> (name, host, port, localDestination, hostOverride, inPort, gzip, i2pheaders);
}
else if (type == I2P_TUNNELS_SECTION_TYPE_IRC) else if (type == I2P_TUNNELS_SECTION_TYPE_IRC)
{
std::string webircpass = section.second.get<std::string> (I2P_SERVER_TUNNEL_WEBIRC_PASSWORD, "");
serverTunnel = std::make_shared<I2PServerTunnelIRC> (name, host, port, localDestination, webircpass, inPort, gzip); serverTunnel = std::make_shared<I2PServerTunnelIRC> (name, host, port, localDestination, webircpass, inPort, gzip);
}
else // regular server tunnel by default else // regular server tunnel by default
serverTunnel = std::make_shared<I2PServerTunnel> (name, host, port, localDestination, inPort, gzip); serverTunnel = std::make_shared<I2PServerTunnel> (name, host, port, localDestination, inPort, gzip);

View file

@ -51,6 +51,7 @@ namespace client
const char I2P_CLIENT_TUNNEL_KEEP_ALIVE_INTERVAL[] = "keepaliveinterval"; const char I2P_CLIENT_TUNNEL_KEEP_ALIVE_INTERVAL[] = "keepaliveinterval";
const char I2P_SERVER_TUNNEL_HOST[] = "host"; const char I2P_SERVER_TUNNEL_HOST[] = "host";
const char I2P_SERVER_TUNNEL_HOST_OVERRIDE[] = "hostoverride"; const char I2P_SERVER_TUNNEL_HOST_OVERRIDE[] = "hostoverride";
const char I2P_SERVER_TUNNEL_I2P_HEADERS[] = "i2pheaders";
const char I2P_SERVER_TUNNEL_PORT[] = "port"; const char I2P_SERVER_TUNNEL_PORT[] = "port";
const char I2P_SERVER_TUNNEL_KEYS[] = "keys"; const char I2P_SERVER_TUNNEL_KEYS[] = "keys";
const char I2P_SERVER_TUNNEL_SIGNATURE_TYPE[] = "signaturetype"; const char I2P_SERVER_TUNNEL_SIGNATURE_TYPE[] = "signaturetype";

View file

@ -925,15 +925,15 @@ namespace client
I2PServerTunnelHTTP::I2PServerTunnelHTTP (const std::string& name, const std::string& address, I2PServerTunnelHTTP::I2PServerTunnelHTTP (const std::string& name, const std::string& address,
uint16_t port, std::shared_ptr<ClientDestination> localDestination, uint16_t port, std::shared_ptr<ClientDestination> localDestination,
const std::string& host, uint16_t inport, bool gzip): const std::string& host, uint16_t inport, bool gzip, bool i2pheaders):
I2PServerTunnel (name, address, port, localDestination, inport, gzip), I2PServerTunnel (name, address, port, localDestination, inport, gzip),
m_Host (host) m_Host (host), m_I2PHeaders (i2pheaders)
{ {
} }
std::shared_ptr<I2PTunnelConnection> I2PServerTunnelHTTP::CreateI2PConnection (std::shared_ptr<i2p::stream::Stream> stream) std::shared_ptr<I2PTunnelConnection> I2PServerTunnelHTTP::CreateI2PConnection (std::shared_ptr<i2p::stream::Stream> stream)
{ {
if (m_XI2P.empty () || stream->GetRemoteIdentity () != m_From.lock ()) if (m_I2PHeaders && (m_XI2P.empty () || stream->GetRemoteIdentity () != m_From.lock ()))
{ {
auto from = stream->GetRemoteIdentity (); auto from = stream->GetRemoteIdentity ();
m_From = from; m_From = from;

View file

@ -241,7 +241,7 @@ namespace client
I2PServerTunnelHTTP (const std::string& name, const std::string& address, uint16_t port, I2PServerTunnelHTTP (const std::string& name, const std::string& address, uint16_t port,
std::shared_ptr<ClientDestination> localDestination, const std::string& host, std::shared_ptr<ClientDestination> localDestination, const std::string& host,
uint16_t inport = 0, bool gzip = true); uint16_t inport = 0, bool gzip = true, bool i2pheaders = true);
private: private:
@ -251,6 +251,7 @@ namespace client
std::string m_Host, m_XI2P; std::string m_Host, m_XI2P;
std::weak_ptr<const i2p::data::IdentityEx> m_From; std::weak_ptr<const i2p::data::IdentityEx> m_From;
bool m_I2PHeaders;
}; };
class I2PServerTunnelIRC: public I2PServerTunnel class I2PServerTunnelIRC: public I2PServerTunnel