What is gRPC, gRPC-Web, and Proxies?


By Ed Marquez
Hedera consensus nodes use gRPC for communications between nodes. Web browsers have technical and security limitations that prevent direct use of standard gRPC. gRPC-Web enables browser-based applications to call gRPC services with familiar web protocols. In this article, we explore what gRPC-Web proxies are, why they are used in the Hiero JS SDK, the role they play in enabling browser-based Hedera applications, and how gRPC-Web proxies are supported by the network.
What Are gRPC-Web Proxies?
gRPC is a high-performance protocol that uses HTTP/2 and protocol buffers. However, browsers have technical and security limitations that prevent direct use of standard gRPC. gRPC-Web was created to let browser apps call gRPC services with familiar web protocols.
A gRPC-Web proxy is a lightweight server between the browser and the gRPC backend. Its job is to convert the browser’s HTTP-based requests into native gRPC calls and vice versa. The browser sends regular HTTP/1.1 or HTTP/2 requests with special content types (e.g. application/grpc-web+proto), and the gRPC-Web proxy translates those into the binary gRPC format understood by the backend service, then relays the response back in a format the browser can handle. In essence, the proxy acts as a bridge that enables gRPC communication over standard web protocols.
Without a gRPC-Web proxy, a web application wouldn’t be able to directly talk to a gRPC service running on a server. The proxy handles necessary tasks like HTTP to HTTP/2 conversion, managing binary Protobuf messages over text-based protocols, and satisfying browser security requirements (such as CORS and TLS).
gRPC-Web Proxies in the Hiero JS SDK
The Hedera consensus nodes use gRPC APIs, which work well in backend environments (like Node.js servers). However, browsers restrict a direct connection to Hedera nodes for front-end web applications due to security sandbox rules. These rules block low-level gRPC streams and enforce using TLS and approved domains, so a dApp running in Chrome or Firefox simply cannot open a raw gRPC connection to a Hedera node.
Developers building on Hedera need a way to call native APIs that use gRPC without running into these restrictions. To enable this, the Hiero JavaScript SDK (formerly Hedera JS SDK) provides built-in support for gRPC-Web proxies. The goal is to make the proxy layer transparent to developers. When the SDK is used in a browser context, it automatically routes all network calls through a gRPC-Web proxy endpoint instead of trying to contact the node directly.
By bundling proxy support directly into the SDK, Hedera enables web developers to start building dApps without needing to deploy any additional infrastructure. You don’t have to know all the details of gRPC-Web or host your own proxy just to get started.
See the proxy information in the JavaScript SDK for the different Hedera environments.
// MAINNET node proxies are the same for both 'WebClient' and 'NativeClient'
export const MAINNET = {
"https://grpc-web.myhbarwallet.com:443": new AccountId(3),
"https://node00.swirldslabs.com:443": new AccountId(3),
"https://node01-00-grpc.swirlds.com:443": new AccountId(4),
"https://node02.swirldslabs.com:443": new AccountId(5),
"https://node03.swirldslabs.com:443": new AccountId(6),
"https://node04.swirldslabs.com:443": new AccountId(7),
"https://node05.swirldslabs.com:443": new AccountId(8),
"https://node06.swirldslabs.com:443": new AccountId(9),
"https://node07.swirldslabs.com:443": new AccountId(10),
"https://node09.swirldslabs.com:443": new AccountId(12),
"https://node10.swirldslabs.com:443": new AccountId(13),
"https://node11.swirldslabs.com:443": new AccountId(14),
"https://node12.swirldslabs.com:443": new AccountId(15),
"https://node14.swirldslabs.com:443": new AccountId(17),
"https://node15.swirldslabs.com:443": new AccountId(18),
"https://node16.swirldslabs.com:443": new AccountId(19),
"https://node17.swirldslabs.com:443": new AccountId(20),
"https://node18.swirldslabs.com:443": new AccountId(21),
"https://node19.swirldslabs.com:443": new AccountId(22),
"https://node20.swirldslabs.com:443": new AccountId(23),
"https://node21.swirldslabs.com:443": new AccountId(24),
"https://node22.swirldslabs.com:443": new AccountId(25),
"https://node24.swirldslabs.com:443": new AccountId(27),
"https://node25.swirldslabs.com:443": new AccountId(28),
"https://node26.swirldslabs.com:443": new AccountId(29),
"https://node27.swirldslabs.com:443": new AccountId(30),
"https://node28.swirldslabs.com:443": new AccountId(31),
"https://node29.swirldslabs.com:443": new AccountId(32),
"https://node30.swirldslabs.com:443": new AccountId(33),
"https://node31.swirldslabs.com:443": new AccountId(34),
};
export const WEB_TESTNET = {
"https://testnet-node00-00-grpc.hedera.com:443": new AccountId(3),
"https://testnet-node01-00-grpc.hedera.com:443": new AccountId(4),
"https://testnet-node02-00-grpc.hedera.com:443": new AccountId(5),
"https://testnet-node03-00-grpc.hedera.com:443": new AccountId(6),
"https://testnet-node04-00-grpc.hedera.com:443": new AccountId(7),
"https://testnet-node05-00-grpc.hedera.com:443": new AccountId(8),
"https://testnet-node06-00-grpc.hedera.com:443": new AccountId(9),
};
export const WEB_PREVIEWNET = {
"https://previewnet-node00-00-grpc.hedera.com:443": new AccountId(3),
"https://previewnet-node01-00-grpc.hedera.com:443": new AccountId(4),
"https://previewnet-node02-00-grpc.hedera.com:443": new AccountId(5),
"https://previewnet-node03-00-grpc.hedera.com:443": new AccountId(6),
"https://previewnet-node04-00-grpc.hedera.com:443": new AccountId(7),
"https://previewnet-node05-00-grpc.hedera.com:443": new AccountId(8),
"https://previewnet-node06-00-grpc.hedera.com:443": new AccountId(9),
};
gRPC-Web Proxies for Web-Based dApps
In practice, every interaction, like creating accounts, querying balances, or submitting transactions, goes through a proxy when using the Hiero JS SDK in a browser. The SDK automatically routes these calls through the proxy, which converts browser requests into standard gRPC calls and then back to a browser-friendly format. This setup meets browser security rules and simplifies development.
The primary benefit of the proxy system is quick and easy connectivity to the Hedera network from web apps. For those developers who want more control in their applications, the SDK allows configuring a custom network or proxy addresses.
A Look Ahead: gRPC-Web Proxies in the Address Book
At the moment, information about gRPC-Web proxies is not part of the network address book. HIP-1046 (accepted but not implemented at the time of this writing) proposes adding support for gRPC-Web proxy endpoints to the address book. With the implementation of this HIP, the Hiero JS SDK will be able to dynamically discover and use these addresses. Each node can provide its own browser-friendly endpoint with native support for gRPC-Web proxies.
This approach removes the need for hard-coded proxy servers or any manual configuration. Browser-based applications will be able to connect more directly, giving developers an even simpler user experience.
Closing Thoughts
We covered gRPC-Web proxies, what they enable, and the role they play on the Hedera network. These proxies have enabled easy and robust connectivity and access for browser-based applications on Hedera. In addition, enhancements like the upcoming native gRPC-Web support in the address book will make it even easier for apps to communicate directly with consensus nodes.
Now that you know about gRPC, gRPC-Web, and proxies, it’s time for you to build your next project on Hedera using the Hiero JavaScript SDK. Be sure to also join our growing community on Discord to share ideas, get support, and help build the future. #HelloFuture
Subscribe to my newsletter
Read articles from Hedera Team directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
