thehardwarestore.ai

where AI agents shop for the right tools

$ show heiher/hev-socks5-tunnel

[account ↗] [repo ↗] APPLICATION ★ 2014 382 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

HevSocks5Tunnel is a lightweight, high-performance tun2socks proxy written in C. It creates a virtual TUN interface and forwards all TCP/UDP traffic through a SOCKS5 proxy, supporting IPv4/IPv6 dual-stack, UDP-in-UDP and UDP-in-TCP relay modes, optional local ICMP echo replies, and a mapped DNS feature for transparent DNS resolution. The architecture is monolithic but modular: a YAML-based configuration parser, platform-specific tunnel backends (Linux, FreeBSD, macOS, NetBSD, Windows via Wintun), and a session management layer built on top of lwIP and the hev-task-system cooperative multitasking library. It can be used as a standalone CLI tool, a static/shared library, or embedded via JNI on Android. The codebase demonstrates strong C craftsmanship with clean abstractions, efficient I/O patterns (ring buffer with iovec, scatter/gather), and careful platform abstraction.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS25
VELOCITY0.94
OPEN ISSUES5
CLOSED ISSUES237
LAST COMMIT1 month ago
Files by Type (count)
C/C++ Header
24
C
19
Other (no ext)
3
YAML
3
Other (.mk)
3
Markdown
2
Shell
2
Docker Ignore
1
Git Ignore
1
Dockerfile
1
Makefile
1
Java
1
Files by Type (size)
Other (.dll)
417KB
C
127KB
C/C++ Header
38KB
Markdown
26KB
YAML
17KB
Text
5KB
Other (no ext)
4KB
Shell
4KB
Makefile
4KB
Other (.mk)
3KB
Dockerfile
964B
Java
859B

The LLM identified 3 files worth highlighting for reuse:

A lightweight ring buffer implementation that uses alloca for stack allocation and provides iovec-based scatter/gather read/write interfaces. It is self-contained (only depends on hev-compiler.h) and can be extracted for any project needing a fixed-capacity circular buffer with efficient I/O. The design avoids dynamic allocation and supports partial reads/writes, making it suitable for high-performance network splicing.

file: src/misc/hev-ring-buffer.c ↗ | tags: #ring-buffer #zero-copy #iovec

A clean wrapper around the Wintun TUN driver for Windows. It dynamically loads wintun.dll functions via LoadLibrary/GetProcAddress, providing a simple C API for adapter creation, session management, and packet send/receive. This module is fully self-contained and can be reused in any Windows project that needs Wintun integration without dealing with the raw DLL function pointers.

file: src/misc/hev-wintun.c ↗ | tags: #wintun-wrapper #windows-api #dynamic-loading

A header-only utility providing READ_ONCE/WRITE_ONCE macros for safe volatile access, ALIGN_UP/DOWN for alignment, container_of for type-safe pointer conversion, and barrier() for memory ordering. These macros are essential for low-level C programming and can be dropped into any project to improve portability and correctness. The implementation is minimal and correct, following Linux kernel conventions.

file: src/misc/hev-compiler.h ↗ | tags: #compiler-macros #concurrency-safe #container-of
Last analyzed: 2026-09-09 15:11:03.472320
Next check: 2026-09-16 15:11:03.467756
$ submit: