tonic-web

Enables tonic servers to handle requests from grpc-web clients directly, without the need of an external proxy.

Getting Started

toml [dependencies] tonic_web = "0.1"

Enabling tonic services

The easiest way to get started, is to call the function with your tonic service and allow the tonic server to accept HTTP/1.1 requests:

```rust

[tokio::main]

async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = GreeterServer::new(MyGreeter::default());

Server::builder()
   .accept_http1(true)
   .add_service(tonic_web::enable(greeter))
   .serve(addr)
   .await?;

Ok(()) } ```

Examples

See the examples folder for a server and client example.