xtaci/kcp-go

A crypto-secure Reliable-UDP library for Golang with FEC support.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 53 minutes ago
Added to GitGenius on September 15th, 2026
Created on June 16th, 2015
Open Issues & Pull Requests: 71 (+0)
GitHub issues: Enabled
Number of forks: 808
Total Stargazers: 4,555 (+0)
Total Subscribers: 137 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 5.2 hours
Mean response time: 65.8 days
90th percentile: 272.2 days
Tracked items: 18

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 15
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 541 days
Stale 30+ days: 14
Stale 90+ days: 12

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

kcp-go is a Reliable-UDP library for Go that delivers ordered, error-checked stream communication over UDP packets with built-in encryption and forward error correction.

The library solves the problem of achieving low-latency, reliable communication in scenarios where TCP's overhead is unacceptable. It implements the KCP protocol, which prioritizes speed over strict ordering by using a faster retransmission strategy. The approach includes forward error correction using Reed-Solomon codes to recover lost packets without retransmission, packet-level encryption supporting multiple cipher algorithms in CFB mode and AEAD modes for anonymous packet delivery, and careful memory management optimized for cache efficiency. The implementation uses a fixed number of goroutines across the entire server to minimize context-switching overhead and includes platform-specific optimizations like sendmmsg and recvmmsg on Linux.

Developers should choose this tool for latency-sensitive applications such as online games, live broadcasting, file synchronization, and network acceleration where TCP's latency characteristics are problematic. The library is designed to handle over five thousand concurrent connections on a single commodity server. It provides a drop-in replacement for net.TCPConn, implementing the standard net.Conn and net.Listener interfaces, which simplifies integration into existing Go codebases. The tool suits projects requiring high throughput with low latency and those operating in unreliable network conditions where packet loss is common.

The project maintains active development with regular updates to its codebase. Documentation is comprehensive, including detailed Godoc references and design documentation covering key considerations like memory management, timing accuracy, and packet clocking strategies. The README includes performance benchmarks, flame graphs for profiling analysis, and practical examples demonstrating usage patterns. The project has seen real-world deployment across millions of devices ranging from low-end MIPS routers to high-end servers, with documented use cases in production systems.