Skip to content

Commit 964037e

Browse files
shreyas-samsungshreyas-samsung
andauthored
Add documentation to show client-side/bi-directional streaming using websockets (#1120)
* Add documentation for websocket transport * Fix a broken link * Update websocket.md * Add link to websocket.md in client docs Co-authored-by: shreyas-samsung <[email protected]>
1 parent 90ce72a commit 964037e

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ It is very important to note that the gRPC-Web spec currently *does not support
166166

167167
This, however, is useful for a lot of frontend functionality.
168168

169+
*Note that `@improbable-eng/grpc-web` provides a built-in [websocket](./client/grpc-web/docs/websocket.md) transport that can support client-side/bi-directional streaming RPCs.*
170+
169171
## Status
170172

171173
The code here is `alpha` quality. It is being used for a subset of Improbable's frontend single-page apps in production.

client/grpc-web/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ Refer to [grpc-web-node-http-transport](https://www.npmjs.com/package/@improbabl
9292
* [Code Generation](docs/code-generation.md)
9393
* [Concepts](docs/concepts.md)
9494
* [Transport](docs/transport.md)
95+
* [Client-side streaming](docs/websocket.md)

client/grpc-web/docs/websocket.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Client-side streaming over websocket
2+
3+
Due to the [limitations](./transport.md#http2-based-transports) of HTTP/2 based transports in browsers, they cannot support client-side/bi-directional streaming. `@improbable-eng/grpc-web` provides a built-in [websocket](./transport.md#socket-based-transports) transport that alleviates this issue.
4+
5+
## Enabling at the client side
6+
7+
To enable websocket communication at the client side, `WebsocketTransport` needs to be configured. See [this](./transport.md#specifying-transports) on how to configure a transport in your application.
8+
9+
## Enabling at the server side
10+
11+
### grpcwebproxy
12+
13+
If you're using `grpcwebproxy` to front your gRPC server, see [this](../../../go/grpcwebproxy/README.md#enabling-websocket-transport).
14+
15+
### grpcweb
16+
17+
If you're using `grpcweb` module as a wrapper around your gRPC-Go server, see [this](../../../go/grpcweb#func--withwebsockets).

0 commit comments

Comments
 (0)