From 41be330e000798036c5e23ae88f0d627ad52ad7d Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 19 Apr 2021 20:49:48 -0300 Subject: [PATCH] Add ifdef'ed proxy requests code --- contrib/onion-request.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/contrib/onion-request.cpp b/contrib/onion-request.cpp index 846da8b..2c6c680 100644 --- a/contrib/onion-request.cpp +++ b/contrib/onion-request.cpp @@ -158,7 +158,8 @@ void onion_request(std::string ip, uint16_t port, std::vector{}},}.dump(); + + auto control = nlohmann::json{ + {"headers", std::array{}}}.dump(); + +#else + // A proxy request to a target (which must start '/oxen/' or '/loki' and end '/lsrpc'): + auto payload = ""s; + auto control = nlohmann::json{ + {"host", "jagerman.com"}, + {"target", "/oxen/lsrpc"}}.dump(); +#endif + + auto data = encode_size(payload.size()) + payload + control; + blob = e.encrypt(EncryptType::aes_gcm, data, keys.back().second); final_seckey = a; final_pubkey = A;