ZaStoGram/TMessagesProj/jni/zsg_naive/WarpEntry.h
loop-uh 15792a0f67
Some checks failed
Build three ZaStoGram APKs / build (arm64-v8a, ZaStoGram-standalone-arm64-v8a, Arm64, arm64) (push) Failing after 41s
Build three ZaStoGram APKs / build (armeabi-v7a, ZaStoGram-standalone-armeabi-v7a, Armv7, armv7) (push) Failing after 41s
ZaStoGram source guards / guards (push) Failing after 16s
Build three ZaStoGram APKs / build (x86, ZaStoGram-standalone-x86, X86, x86) (push) Failing after 36s
WARP entry hop (opt-in): native WireGuard+lwIP engine from naive-core (848f94c), loopback forward ports for tgnet/WSS/Naive/pool first hops, settings row, account registration
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-27 15:02:26 -05:00

22 lines
855 B
C++

/* Cloudflare WARP as an optional ENTRY hop (jni/zsg_naive/WarpEntry.cpp). With the setting on, the TCP connections of
* tgnet (direct, MTProxy, WSS, Naive) go to a loopback port of the zsgnaive library instead of the real address; the
* library carries the bytes through a WireGuard tunnel to WARP. A tunnel that is not up leaves every connection direct. */
#ifndef ZSG_NAIVE_WARP_ENTRY_H
#define ZSG_NAIVE_WARP_ENTRY_H
#include <jni.h>
#include <netinet/in.h>
namespace tgnet {
namespace naive {
/* If the tunnel is up and |address| is a public IPv4 address, fills |redirected| with 127.0.0.1:<forward port> and
* returns true; the caller connects to |redirected| instead. Any thread. */
bool WarpRedirect(const sockaddr_in &address, sockaddr_in *redirected);
bool RegisterWarpJni(JNIEnv *env);
} // namespace naive
} // namespace tgnet
#endif