gRPC
[!NOTE] This document is partially generated by AI.
gRPC is a high-performance transport protocol based on HTTP/2 and Protocol Buffers. In yuhaiin, it is used to tunnel proxy traffic through bi-directional gRPC streams.
Network Support
Section titled “Network Support”- TCP: Supported (Stream-based).
- UDP: Not supported. gRPC is inherently stream-oriented.
Client Configuration (Outbound)
Section titled “Client Configuration (Outbound)”When used as an outbound transport, the grpc block uses the following simplified configuration:
Configuration Fields
Section titled “Configuration Fields”tls: A nested TLS configuration block. gRPC requires a TLS layer for connection establishment.enable(bool): (Required) Set totrue.servernames(string array): SNI for the gRPC server.
Server Configuration (Inbound)
Section titled “Server Configuration (Inbound)”For an inbound gRPC server, the configuration is typically handled at the listener level.
Configuration Fields
Section titled “Configuration Fields”- The
grpcInbound does not have dedicated configuration fields in thegrpcblock itself; it relies on the underlying TLS and listener setup.
Example Configuration
Section titled “Example Configuration”{ "grpc": { "tls": { "enable": true, "servernames": ["grpc.example.com"] } }}Developer Details
Section titled “Developer Details”Implementation
Section titled “Implementation”yuhaiin implements a specific gRPC service that allows for streaming raw binary data (TCP/UDP) over HTTP/2 streams. This is often more resilient to detection in environments that already use heavy gRPC traffic.
Package
Section titled “Package”Located in pkg/net/proxy/grpc. It utilizes the official google.golang.org/grpc library.