Skip to content

Releases: fscarmen/cfnat

v0.0.9

23 Jun 02:29

Choose a tag to compare

refactor: release v0.0.9 — EventLoop abstraction, BatchIterator, cache-valid optimization, and race fix

  • add cross-platform EventLoop I/O framework (epoll / kqueue / IOCP) replacing select()
  • add BatchIterator for lazy CIDR expansion (1024 IPs per batch), reducing memory usage
  • add cache_valid flag to CandidatePool, skipping redundant health checks on known-good IPs
  • add recv_timeout() with configurable timeout, replace blocking recv in pipe_worker and connection_thread
  • use Linux splice() for zero-copy forwarding in pipe_worker; unify all platforms on recv_timeout(300s)
  • fix race between carrier_rescan_and_select_ip free(items) and carrier_choose_ip_for_connection items traversal by protecting with candidates.mu
  • remove global candidate state (g_candidates, g_current_ip, etc.) in favor of per-pool management
  • add version string (CFNAT_VERSION "0.0.9") and -V / -version flag

refactor: 发布 v0.0.9 — 引入 EventLoop 抽象层、BatchIterator、缓存有效优化与竞态修复

  • 新增跨平台 EventLoop 事件驱动 I/O 框架(epoll / kqueue / IOCP),替代 select() 模型
  • 新增 BatchIterator 惰性 CIDR 批量迭代(每批 1024 个 IP),降低内存占用
  • CandidatePool 新增 cache_valid 标志,健康 IP 跳过冗余检测,直接复用
  • 新增 recv_timeout() 可配置超时接收,替换 pipe_worker 与 connection_thread 中的阻塞 recv
  • pipe_worker Linux 平台使用 splice() 零拷贝转发;全平台统一 recv_timeout(300s)
  • 修复 carrier_rescan_and_select_ip 中 free(items) 与 carrier_choose_ip_for_connection 遍历 items 的竞态,使用 candidates.mu 互斥锁保护
  • 移除全局候选状态(g_candidates、g_current_ip 等),状态归入 CandidatePool 管理
  • 新增版本号(CFNAT_VERSION "0.0.9")及 -V / -version 命令行参数

v0.0.8

17 Jun 01:04

Choose a tag to compare

fix: v0.0.8 align health check timeout with user-configured delay_ms

  • replace hardcoded 2000ms timeout in health_check_ip and carrier_health_check_ip with g_cfg.delay_ms
  • fix mismatch where a low -delay (e.g. 500ms) kept an IP alive in health checks while client connections timed out against the same IP
  • apply the fix to all 8 dial + probe calls across Baidu and Carrier health check paths

fix: v0.0.8 健康检查超时改为与用户设置的 -delay 一致

  • health_check_ipcarrier_health_check_ip 中硬编码的 2000ms 超时替换为 g_cfg.delay_ms
  • 修复当 -delay 设为较低值(如 500ms)时,健康检查用 2000ms 判定 IP 可用,但客户端连接用 500ms 超时而连不上的问题
  • 同步修复百度直连模式和运营商模式共 8 处 dial + probe 调用

v0.0.7

08 Jun 01:42

Choose a tag to compare

feat: release v0.0.7 with dual listening mode (direct + baidu proxy)

  • support -direct-listen and -baidu-listen parameters
  • add mixed mode when direct-listen and baidu-listen are the same address
  • refactor carrier listening logic and health check for better clarity and stability
  • simplify Config structure and remove legacy multi-carrier resolver code
  • improve connection selection and fallback between direct and baidu proxy

feat: 发布 v0.0.7,支持双监听模式(直连 + 百度前置代理)

  • 支持 -direct-listen 和 -baidu-listen 参数
  • 新增两个监听地址相同时的 mixed 混合模式
  • 重构运营商监听逻辑与健康检查,提升代码清晰度和稳定性
  • 精简 Config 结构体,移除遗留的多运营商解析代码
  • 优化直连与百度前置代理的连接选择和回退机制

v0.0.6

29 May 00:28

Choose a tag to compare

feat: release v0.0.6 with carrier listen priority over Baidu proxy config

  • force -baidu-proxy=true automatically when -carrier-listens is configured
  • make carrier split-port mode take priority over explicit -baidu-proxy=false
  • add startup notice when carrier listen mode enables Baidu proxy automatically
  • simplify carrier listen examples by removing the need to set -baidu-proxy=true
  • update README to document -carrier-listens priority and automatic Baidu proxy behavior

feat: 发布 v0.0.6,让运营商监听优先于百度代理配置

  • 配置 -carrier-listens 时自动强制启用 -baidu-proxy=true
  • 让运营商分端口模式优先于显式设置的 -baidu-proxy=false
  • 添加启动提示,说明运营商监听模式会自动启用百度前置代理
  • 简化运营商分池示例,不再需要手动设置 -baidu-proxy=true
  • 更新 README,说明 -carrier-listens 的优先级和自动启用百度前置代理行为

v0.0.5

28 May 03:04

Choose a tag to compare

feat: release v0.0.5 with unified C source and simplified cache startup

  • merge Linux, macOS, and Windows implementations into cfnat.c
  • replace split source files with platform-specific conditional compilation
  • keep Windows support for Winsock2, WinINet, DNS API, and Unicode console output
  • keep Linux and macOS support for POSIX sockets, pthreads, and built-in DNS TXT lookup
  • update GitHub Actions to build all platforms from cfnat.c
  • update release packaging to include the unified source file
  • refresh README with single-source build commands and platform notes

feat: 发布 v0.0.5,合并 C 源码并简化缓存启动逻辑

  • 将 Linux、macOS、Windows 三个平台实现合并到 cfnat.c
  • 使用平台条件编译替代分裂源码维护
  • 保留 Windows 的 Winsock2、WinINet、DNS API 和 Unicode 控制台输出支持
  • 保留 Linux 与 macOS 的 POSIX socket、pthread 和内置 DNS TXT 查询支持
  • 更新 GitHub Actions,所有平台统一从 cfnat.c 构建
  • 更新 release 打包,只附带统一后的源码文件
  • 更新 README,补充单源码构建命令和平台说明

v0.0.4

25 May 13:15

Choose a tag to compare

feat: release v0.0.4 with fast-start cache and scan optimization

  • add startup cache system for previously verified candidate IPs
  • enable immediate startup from cached healthy IPs before full scan
  • add background refresh scanning and automatic cache rewrite
  • separate cache files for IPv4 / IPv6 and Baidu proxy modes
  • improve scan progress visibility and runtime diagnostics

feat: 发布 v0.0.4,加入快速启动缓存与扫描优化

  • 添加历史有效 IP 启动缓存系统
  • 启动时优先使用缓存中的健康 IP,避免每次全量扫描
  • 添加后台刷新扫描与自动缓存回写
  • 为 IPv4 / IPv6 与百度代理模式分别使用独立缓存文件
  • 改进扫描进度显示与运行统计日志

v0.0.3

24 May 06:47

Choose a tag to compare

feat: release v0.0.3 C build with proxy routing and platform fixes

  • add Baidu CONNECT proxy support with carrier-specific listen pools
  • simplify candidate selection to always use the lowest score IP and fail over to the next best candidate
  • add scan progress, scan statistics, and UNK fallback for TCP-reachable candidates without readable CF-RAY
  • fix Windows 7 console output by writing Unicode logs through WriteConsoleW
  • fix Windows data downloads by replacing external curl / wget calls with WinINet
  • update release builds for Linux glibc dynamic and supported musl static targets
  • normalize runtime data files to ips-v4.txt, ips-v6.txt, and locations.json
  • refresh README for v0.0.3 usage, build matrix, troubleshooting, and platform notes

feat: 发布 v0.0.3 C 版,加入代理分流并修复多平台兼容问题

  • 添加百度 CONNECT 前置代理和运营商独立监听池
  • 简化候选选择逻辑,始终使用 score 最低 IP,并在失败后切换到下一个最优候选
  • 添加扫描进度、扫描统计,以及 TCP 可达但无法读取 CF-RAY 时的 UNK 候选回退
  • 通过 WriteConsoleW 输出 Unicode 日志,修复 Windows 7 控制台中文乱码
  • 使用 WinINet 替代外部 curl / wget,修复 Windows 数据文件下载问题
  • 更新发布构建,提供 Linux glibc 动态版和受支持的 musl 静态版
  • 统一运行数据文件为 ips-v4.txtips-v6.txtlocations.json
  • 更新 README,补充 v0.0.3 用法、构建矩阵、排错和平台说明

v0.0.2

03 May 14:08

Choose a tag to compare

feat: unify select-based routing model across C platforms

  • replace public mode flags with -select=best|first|rotate|random across Linux, macOS, and Windows
  • implement score-based candidate ranking for best using latency and loss rate instead of exposing internal sort modes
  • add IPv6 listen address parsing and socket binding support, including bracketed forms like [::]:port
  • consolidate runtime logging into -log=silent|error|warn|info|debug and improve interruptible wait behavior for cleaner shutdown
  • optimize long-running resource cleanup and keep candidate / location memory release paths aligned

feat: 统一 C 版跨平台的 select 路由模型

  • 在 Linux、macOS 和 Windows 中统一改为对外使用 -select=best|first|rotate|random
  • best 改为基于延迟与丢包率的 score-based 综合评分,不再暴露内部排序模式
  • 增加 IPv6 监听地址解析与绑定支持,包括 [::]:port 这类方括号形式
  • 将运行时日志统一收口为 -log=silent|error|warn|info|debug,并优化可中断等待逻辑以改善退出行为
  • 优化常驻运行时的资源回收,统一候选池与 location 数据释放路径

v0.0.1

30 Apr 01:54

Choose a tag to compare

A lightweight Cloudflare IP scanner and TCP forwarding tool.