An open API service indexing awesome lists of open source software.

https://github.com/stevenferrer/ping-http-grpc

Ping via HTTP and gRPC on the same port using cmux.
https://github.com/stevenferrer/ping-http-grpc

cmux golang grpc http

Last synced: 9 months ago
JSON representation

Ping via HTTP and gRPC on the same port using cmux.

Awesome Lists containing this project

README

          

# ping-http-grpc

Ping via HTTP and [gRPC](https://grpc.io) on the same port using [cmux](https://github.com/soheilhy/cmux).

## Running the examples

Run the server.

```sh
$ go run cmd/server/main.go
2022/09/02 21:49:42 grpc server started.
2022/09/02 21:49:42 http server started.
2022/09/02 21:49:42 cmux started.
```

Ping via HTTP.

```sh
$ curl http://localhost:8080
pong
```

Ping gRPC.

```sh
$ go run cmd/pingclient/main.go
pong
```

## License

[MIT](./LICENSE)