https://github.com/kalmhq/echoserver
A test image for http1.1, http2, GRP, TCP, UDP protocols.
https://github.com/kalmhq/echoserver
docker-image grpc-server grpcurl http-server http2-server protocols testing
Last synced: about 1 month ago
JSON representation
A test image for http1.1, http2, GRP, TCP, UDP protocols.
- Host: GitHub
- URL: https://github.com/kalmhq/echoserver
- Owner: kalmhq
- Created: 2020-07-31T13:25:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T06:45:04.000Z (over 5 years ago)
- Last Synced: 2024-11-15T04:46:21.805Z (over 1 year ago)
- Topics: docker-image, grpc-server, grpcurl, http-server, http2-server, protocols, testing
- Language: Go
- Homepage: https://github.com/kalmhq/echoserver
- Size: 26.4 KB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Intro
This is a test project. Run different protocols on multiple ports to test the protocol forwarding in istio.
| Port | Protocols |
|------|------------------------------------------------------------------------------------|
| 8001 | Plain http server. Supports http/1.0, http/1.1 |
| 8002 | Non-TLS http2 server, aka h2c. Supports upgrade from http/1.1 and prior knowledge. |
| 8003 | TLS-Enabled http2 server. |
| 8004 | Non-TLS Grpc server. |
| 8005 | TLS-Enabled Grpc server. |
| 8006 | Non-TLS TCP server. |
| 8007 | UDP server. |
# Run
### localhost
pull this repo and run
```bash
go run .
```
### docker
```bash
docker run --rm -p 8001-8010:8001-8010 kalmhq/echoserver:latest
```
# Test
Before run tests. Upgrade your `curl` to the lastest version.
### Test 8001
```bash
# http 1.0
curl --http1.0 http://localhost:8001/path\?query\=1 -v
# => http 1.0 response
# http 1.1
curl --http1.1 http://localhost:8001/path\?query\=1 -v
# => http 1.1 response
# http 2
curl --http2 http://localhost:8001/path\?query\=1 -v
# => http 1.1 response
```
### Test 8002
```bash
# http 1.0
curl --http1.0 http://localhost:8002/path\?query\=1 -v
# => http 1.0 response
# http 1.1
curl --http1.1 http://localhost:8002/path\?query\=1 -v
# => http 1.1 response
# http 2~
curl --http2 http://localhost:8002/path\?query\=1 -v
# => switching protocol, connection upgrade
# => http 2 response
# http 2
curl --http2-prior-knowledge http://localhost:8002/path\?query\=1 -v
# => use h2 directly
# => http 2 response
```
### Test 8003
```bash
# http 1.1
curl --http1.1 https://localhost:8003/path\?query\=1 -v -k
# => http 1.1 response
# http 2
curl --http2 https://localhost:8003/path\?query\=1 -v -k
# => ALPN h2
# => http 2 response
```
### Test 8004
Please make sure you have [grpcurl](https://github.com/fullstorydev/grpcurl) installed.
```bash
grpcurl -plaintext localhost:8004 main.HelloWorld/Greeting
```
### Test 8005
Please make sure you have [grpcurl](https://github.com/fullstorydev/grpcurl) installed.
```bash
grpcurl -insecure localhost:8005 main.HelloWorld/Greeting
```
### Test 8006
Use `telnet`
```bash
telnet localhost 8006
# type something and press enter
# Use ctrl + ] and ctrl + D to exit
```
Use `nc`
```bash
nc -v localhost 8006
# type something and press enter
# Use ctrl + c to exit
```
### Test 8007
Use `nc`
```bash
nc -uv localhost 8007
# type something and press enter
# Use ctrl + c to exit
```