A bridge for Qv2ray and v2ray-core to communicate with each other.
// connect to grpc server
extern char* Dial(char* address, uint32_t timeout);
// get information from server
extern uint64_t GetStats(char* name, uint32_t timeout);
Before getting information from GetStats
, one must call Dial
in prior to setup connection:
Dial("127.0.0.1:14950", 10000);
This API call is blocking, so be careful when using in main thread.
After that, one can call GetStats
to fetch information from v2ray-core:
// uint64_t
auto stats = GetStats("inbound>>>socks_IN>>>traffic>>>downlink", 3000);
This library is provided as a .a
file to preserve compatibility between different linkers.
Note that you may need to link -framework Security
on macOS.