Among transports, besides TCP and WebSocket, gRPC is a common choice. Built on HTTP/2, it has a distinct character.
What sets it apart
- Multiplexing: HTTP/2 lets many requests share one connection, cutting repeated handshakes and smoothing weak networks.
- CDN-friendly: many CDNs natively support HTTP/2 / gRPC, so it pairs well with a CDN to hide the origin.
- Looks like a normal API: gRPC is a common service-to-service protocol, so its traffic shape is unremarkable.
Versus WebSocket
WebSocket is more universal with the best compatibility; gRPC has the edge on long-lived connections and multiplexing, but some CDNs or middleboxes handle gRPC poorly, which can make it less stable. Both should run with TLS.
Config essentials
The key is serviceName, which must match on both ends — the gRPC equivalent of WebSocket's path. Add TLS on the outer layer as well.
With no specific network problem, WebSocket and gRPC feel similar — don't overthink it. If WS keeps dropping, try switching to gRPC and see whether it's steadier.