How jsvjxgy/tfrpc works
tfrpc is a pure-C frp client that reads TOML configuration, connects to an frps server, registers configured proxies, and relays traffic between local services and server-side work connections. The runtime spans control messaging, transport selection, TLS, and per-proxy compression/encryption. README documentation establishes the product workflow and supported capabilities; source excerpts show connection-layer integrations. Some orchestration details are unsampled, so those links are omitted rather than inferred.
Main entry points: tconn.c Connection abstraction · control.c Control channel · quic.c QUIC transport · tls.c TLS handshake
Components 19
Client workflow
- Configuration
src/config.c - Client process
src/main.c - Control channel
src/control.c
Transport and protocol
- Message protocol
src/proto.c - Wire v2
src/v2.c - Connection abstraction
src/tconn.c - TCP sockets
src/net.c - KCP transport
src/kcpconn.c - QUIC transport
src/quic.c - Yamux streams
src/yamux.c
Security and codecs
- TLS handshake
src/tls.c - Certificate checks
src/x509.c - Key exchange
src/x25519.c - Crypto primitives
src/crypto.c - Snappy codec
src/snappy.c
Proxy relay
- Work connections
src/workconn.c
Other components
- Operator
- Local services
- frps server
Connections 21
- Operator → Configuration: provides settings
README.md - Operator → Client process: starts client
README.md - Client process → frps server: connects to
README.md - frps server → Control channel: accepts control
README.md - Control channel → Message protocol: exchanges messages
README.md - Control channel → Work connections: coordinates proxies
- Work connections → Local services: relays traffic
README.md - Work connections → frps server: opens work connection
README.md - Connection abstraction → TLS handshake: wraps transport
src/tconn.c - Connection abstraction → KCP transport: reads and writes
src/tconn.c - Connection abstraction → QUIC transport: uses streams
- Connection abstraction → Yamux streams: uses streams
src/tconn.c - Connection abstraction → Snappy codec: compresses data
src/tconn.c - Connection abstraction → Crypto primitives: encrypts data
src/tconn.c - TLS handshake → Key exchange: derives shared key
src/tls.c - TLS handshake → Certificate checks: verifies certificates
src/tls.c - QUIC transport → Certificate checks: checks certificates
src/quic.c - QUIC transport → Key exchange: uses key agreement
src/quic.c - Control channel → Wire v2: uses v2 framing
- Control channel → Connection abstraction: uses connection layer
- Connection abstraction → TCP sockets: uses sockets