echo/

directory
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0

README

Example gRPC Echo Server

This example server demonstrates how to run gRPC accessible via grpc, grpc-web, grpc-gateway, and grpc-over-webrtc all on the same port while hosting other HTTP services.

Build

make build

Run

  1. make run-server
  2. make run-client
With auth
  1. make run-server-auth
  2. make run-client-auth
With auth via mTLS (no UI)
  1. make run-server-auth-tls
  2. make run-client-auth-tls
With an external auth source
  1. make run-server-auth-internal # Use the UI on this one
  2. make run-server-auth-external
  3. make run-client-auth-external

Using

  1. Go to http://localhost:8080 and look at the developer console.
  2. Try curl -XPOST http://localhost:8080/api/v1/echo\?message\=foo
  3. Try grpcurl -plaintext -d='{"message": "hey"}' localhost:8080 proto.rpc.examples.echo.v1.EchoService/Echo

Directories

Path Synopsis
Package main runs a gRPC client over WebRTC connecting to the proto/rpc/examples/echo/v1 service.
Package main runs a gRPC client over WebRTC connecting to the proto/rpc/examples/echo/v1 service.
Package server implement an echo server.
Package server implement an echo server.
cmd
Package main runs a gRPC server running the proto/rpc/examples/echo/v1 service.
Package main runs a gRPC server running the proto/rpc/examples/echo/v1 service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL