Skip to content

Enable transport over WebSocket (with support of wasm) #491

Open
@boxdot

Description

@boxdot

I have an experimental implementation of a Connector which allows to tunnel gRPC communication over a WebSocket. This makes it possible to implement a gRPC-over-WebSocket server and more importantly also a client. With small patches of h2 and tower-buffer the client also runs in wasm32.

If you find this useful and my approach as suitable, I would like to discuss how to move forward from here.

Feature Request

Crates

  • tonic (transport module)
  • h2
  • tower-buffer

Motivation

Run gRPC in browser.

Proposal

(High level)

  • Expose the client parts that are independent of TCP and work in wasm as a separate feature.
  • Use this new feature and the new tonic-ws-transport crate to enable implementations of wasm clients.

I am not sure if this should become a separate feature of tonic crate though, or we could do it differently. Due to this bug in cargo (rust-lang/cargo#2524), we might run into problems if we choose conditional compilation based on wasm32 target arch.

Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tonicC-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions