4 ms·
What are the benefits of using HTTP rather than TCP directly? I guess one of them is easy to pass firewalls. Anything else makes HTTP better than raw TCP for RP
by wbsun 12y ago
What are the benefits of using HTTP rather than TCP directly? I guess one of them is easy to pass firewalls. Anything else makes HTTP better than raw TCP for RPC?
- somethingnew 12y agoNot having to worry about calculating the length of the message before transferring it?
- ejona86 12y agogRPC actually still has to calculate the length of a message before transferring it.
- teraflop 12y agoThere wouldn't be much benefit to using HTTP/1.1, but HTTP/2 makes it easy to pipeline and multiplex requests over a single TCP connection.
- ejona86 12y agoHTTP/2 is quite featureful and provides most of the advanced needs that gRPC has; HTTP/2 is pretty similar to what we would make ourselves if gRPC used TCP directly. Using HTTP/2 though also allows fitting into the wider web ecosystem of proxies, reverse proxies, load balancers/TLS terminators, and developer familiarity.