8000 GitHub - mfernd/grpc_to_http_stream: Examples to convert a gRPC tonic stream to HTTP stream (SSE)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mfernd/grpc_to_http_stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC to HTTP streaming examples

Examples to convert gRPC tonic stream to HTTP stream (SSE).

Snippets from frameworks like:

How to run

gRPC tonic server

cargo run --bin grpc_server

Will start the gRPC server on localhost:50051 by default.

This can be changed with env variables APP_HOST and APP_PORT.

Axum HTTP server

GRPC_URI="localhost:50051" cargo run --bin axum_server

Will start the gRPC server on http://localhost:3000/ by default.

This can be changed with env variables APP_HOST and APP_PORT. And you can change the gRPC server URI with the env va 59CF riable GRPC_URI.

You can then test with curl:

curl http://localhost:3000/

Notes

Note

I didn't find solutions to handle errors when dealing with stream on the HTTP SSE side... If anyone has a solution for this, feel free to let me know.

About

Examples to convert a gRPC tonic stream to HTTP stream (SSE)

Topics

Resources

License

Stars

Watchers

Forks

Languages

0