English | 简体中文
A lightweight C SDK for game traffic tunneling and network acceleration with real-time traffic monitoring.
Click to open the Lingti accelerator homepage
Lingti SDK is a high-performance network tunneling library designed for game traffic optimization. It provides a simple C API for integrating network acceleration capabilities into games and applications, featuring real-time traffic monitoring, intelligent routing, and cross-platform support.
The SDK is open source and available at: https://github.com/ruilisi/lingti-sdk
Pre-compiled DLL/lib files for each SDK version are available in the GitHub Releases section.
Each release includes:
lingti_sdk.dll- Main SDK library (13MB)lingti_sdk.lib- Import library for linking (8.6KB)lingti_sdk.h- C header file with API declarationslingti_sdk.def- Module definition file
Note: The lingtiwfp64.sys Windows driver file is included in the repository (not in releases, as it rarely changes). This file must be placed in the same directory as your compiled executable for the SDK to function properly on Windows.
The DLL (Dynamic Link Library) file (lingti_sdk.dll, 13MB) contains all the actual compiled code:
- Complete Go runtime and garbage collector
- All SDK functionality and business logic
- Network tunneling implementation
- Required at runtime when your application executes
Runtime requirement: lingti_sdk.dll must be present when your application runs. Place it:
- In the same directory as your
.exefile (recommended) - In a system directory (e.g.,
C:\Windows\System32) - In any directory listed in your system's PATH environment variable
The LIB (Import Library) file (lingti_sdk.lib, 8.6KB) is much smaller because it contains only:
- Stub code with function name references
- Metadata telling the linker where to find functions in the DLL
- Import table information
The small size (8.6KB vs 13MB) is normal and correct! The import library only contains references to the 9 exported functions, not the actual implementation code.
Compile-time requirement: lingti_sdk.lib is only needed when compiling/linking your application with MSVC. It's not needed at runtime.
| File | Used When | Purpose |
|---|---|---|
lingti_sdk.dll |
Runtime (always) | Contains all actual code, must be distributed with your app |
lingti_sdk.lib |
Compile-time (MSVC only) | Tells linker how to find DLL functions |
lingti_sdk.h |
Compile-time (always) | Provides function declarations for your C code |
MSVC (Visual Studio):
# Compilation requires .lib file
cl your_app.c lingti_sdk.lib
# Runtime requires .dll file in same directory as .exe
your_app.exe # needs lingti_sdk.dll presentMinGW/GCC:
# Can link directly against .dll (no .lib needed)
gcc your_app.c -L. -llingti_sdk -o your_app.exe
# Runtime requires .dll file
./your_app.exe # needs lingti_sdk.dll presentWhen distributing your application, include:
- ✅ Your compiled
.exefile - ✅
lingti_sdk.dll(13MB - required at runtime) - ✅
lingtiwfp64.sys(Windows driver - required at runtime) - ❌
lingti_sdk.lib(NOT needed by end users) - ❌
lingti_sdk.h(NOT needed by end users)
- Simple C API - Clean interface with start/stop service management
- Asynchronous Operation - Non-blocking service execution in background threads
- Real-time Monitoring - Track transmitted/received bytes and packets
- DNS Management - Built-in DNS cache control
- Cross-platform - Windows (DLL), Linux, and macOS support
- Encrypted Configuration - Secure encrypted config via string or file
- Traffic Statistics - Byte and packet-level monitoring
- Error Handling - Comprehensive error codes and messages
#include "../lingti_sdk.h"
int main() {
StartTun2RWithConfigFile("encrypted_config.txt");
return 0;
}#include <stdio.h>
#include "../lingti_sdk.h"
#ifdef _WIN32
#include <windows.h>
#define SLEEP(ms) Sleep(ms)
#else
#include <unistd.h>
#define SLEEP(ms) usleep((ms) * 1000)
#endif
int main() {
printf("Lingti SDK Example\n");
printf("==================\n\n");
// Check SDK version
char* version = GetSDKVersion();
printf("SDK Version: %s\n\n", version);
free(version);
// Path to encrypted config file
// For encryption details, see API.md
const char* configFile = "encrypted_config.txt";
printf("Starting service from config file...\n");
int result = StartTun2RWithConfigFile(configFile);
if (result != 0) {
char* error = GetLastErrorMessage();
printf("Failed to start service (code %d): %s\n", result, error);
free(error);
return 1;
}
printf("Service started successfully!\n\n");
// Check service status
if (IsServiceRunning()) {
printf("Service status: RUNNING\n\n");
}
// Monitor traffic for 30 seconds
printf("Monitoring traffic for 30 seconds...\n");
printf("Press Ctrl+C to stop early\n\n");
for (int i = 0; i < 30; i++) {
unsigned long long txBytes, rxBytes;
GetTrafficStats(&txBytes, &rxBytes, NULL, NULL);
printf("\r[%02d/%02d] TX: %llu bytes | RX: %llu bytes",
i + 1, 30, txBytes, rxBytes);
fflush(stdout);
SLEEP(1000);
}
printf("\n\n");
// Stop the service
printf("Stopping service...\n");
result = StopTun2R();
if (result == 0) {
printf("Service stopped successfully!\n");
} else {
char* error = GetLastErrorMessage();
printf("Failed to stop service (code %d): %s\n", result, error);
free(error);
}
printf("\nExample completed. See API.md for detailed documentation.\n");
return 0;
}The SDK only supports encrypted configuration for enhanced security.
To obtain an encrypted configuration:
- Visit https://game.lingti.com/sdk
- Select your game (需要加速的游戏)
- Select your tunnel line (线路)
- Copy the provided encrypted_config string
The encrypted_config is a Base64-encoded string that contains all necessary tunnel settings.
Click the image below to open the generator and download your encrypted_config file:
Click the image to open the encrypted_config generator
StartTun2RWithConfigFile(const char* configPath)- Start service from encrypted config file (base64 encoded text)StopTun2R(void)- Stop the service gracefullyIsServiceRunning(void)- Check if service is running
GetTrafficStats(...)- Get current traffic statisticsGetSDKVersion(void)- Get SDK version stringGetLastErrorMessage(void)- Get last error messageFlushDNSCache(void)- Flush local DNS cacheRunPing(int intervalMilliSec)- Start periodic ping monitoringStopPing(void)- Stop ping monitoringGetLastPingStats(...)- Get ping statisticsGetConsoleConfig(...)- Get console configurationGetDeviceID(void)- Get device ID
LINGTI_SUCCESS (0)- Operation successfulLINGTI_ERR_NULL_CONFIG (-1)- Invalid/null configurationLINGTI_ERR_JSON_PARSE (-2)- JSON parsing errorLINGTI_ERR_ALREADY_RUN (-3)- Service already runningLINGTI_ERR_LOAD_CONFIG (-4)- Failed to load config fileLINGTI_ERR_NOT_RUNNING (-1)- Service not running
Build the example with all required files:
make exampleThis will create an example/ directory containing:
example.exe- Compiled executablelingtiwfp64.sys- Windows driver filelingti_sdk.dll- SDK library
Clean the build:
make cleanThe Makefile automatically detects your platform:
- Windows: Uses native gcc or MinGW
- Linux/macOS: Uses MinGW cross-compiler (install with
brew install mingw-w64)
gcc your_app.c -L. -llingti_sdk -o your_app.execl your_app.c lingti_sdk.libx86_64-w64-mingw32-gcc your_app.c lingti_sdk.lib -o your_app.exeNode.js native addon (N-API) for the Lingti SDK, providing network tunneling capabilities for game traffic routing.
- Node.js >= 16.0.0
- For runtime: Windows OS (the SDK DLL is Windows-only)
- For building (Windows only):
- Visual Studio 2019 or later with C++ build tools
- Python 3.x
- node-gyp (installed automatically as dependency)
npm install lingti-sdkconst lingti = require('lingti-sdk');
// Check platform compatibility first
if (!lingti.isAddonAvailable()) {
console.log('Platform:', lingti.getPlatform());
console.log('This addon requires Windows to run.');
process.exit(1);
}
// Start the service with encrypted config file (base64 encoded text)
// To obtain encrypted config: visit https://game.lingti.com/sdk
// Select your game (需要加速的游戏) and tunnel line (线路)
const result = lingti.startTun2RWithConfigFile('encrypted_config.txt');
if (result === 0) {
console.log('Service started successfully!');
console.log('SDK Version:', lingti.getSDKVersion());
} else {
console.error('Failed to start:', lingti.getLastErrorMessage());
}
// Check if service is running
if (lingti.isServiceRunning()) {
console.log('Service is active');
}
// Get traffic statistics
const stats = lingti.getTrafficStats();
console.log('TX:', stats.txBytes, 'RX:', stats.rxBytes);
// Stop the service when done
lingti.stopTun2R();The addon includes full TypeScript definitions:
import * as lingti from 'lingti-sdk';
// Start service with encrypted config file
lingti.startTun2RWithConfigFile('encrypted_config.txt');- Windows: Full support (native DLL)
- macOS/Linux: Package installs but native addon is not built (Windows-only DLL)
Note: The package can be installed on any platform, but the native addon will only build and work on Windows. On macOS/Linux, the installation will complete successfully but skip the native build step.
See the examples/ directory for complete working examples:
sdk_example.c- Basic SDK usage demonstrationsdk_example_min.c- Minimal 5-line example
Copyright (c) 2025 Ruilisi
1.8.0(Latest):- Significantly improved performance for TCP-heavy games like Path of Exile 2, introduced bitmap-based UDP packet loss calculation for more accurate and real-time packet loss monitoring
1.7.3:- Fixed ICMP Ping issues for games like Conqueror's Blade, reduced CPU usage for game proxy
1.7.2:- Optimized routing strategy, improved game entry stability for Apex Legends, Battlefield 6, and Marvel Rivals
1.7.0:- Greatly reduced packet loss rate, achieving zero packet loss for games with large UDP packets (e.g., Apex Legends and Marvel Rivals)
- Significantly reduced CPU and memory usage during high-volume TCP downloads, with CPU consumption down to 15% of pre-optimization levels
- Greatly enhanced stability of game traffic proxying
1.6.2:- add SetLogLevel API to change log level at runtime;
- GetLastPingStats now returns UDP packet loss statistics.
1.6.1: reports udp packet loss statistics.1.6.0: largely improves traffic stability and reduces packet loss.