Examples to convert gRPC tonic stream to HTTP stream (SSE).
To no build when running, you can build the project first:
cargo build
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
.
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 variable GRPC_URI
.
You can then test with curl:
curl http://localhost:3000/
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.