Sign inSign up

kalmhq/echoserver

By kalmhq

Updated almost 6 years ago

An image of various protocol ports is turned on for the purpose of testing

Image
0

50K+

kalmhq/echoserver repository overview

Intro

This is a test project. Run different protocols on multiple ports to test the protocol forwarding in istio.

PortProtocols
8001Plain http server. Supports http/1.0, http/1.1
8002Non-TLS http2 server, aka h2c. Supports upgrade from http/1.1 and prior knowledge.
8003TLS-Enabled http2 server.
8004Non-TLS Grpc server.
8005TLS-Enabled Grpc server.
8006Non-TLS TCP server.
8007UDP server.

Run

localhost

pull this repo and run

go run .
docker
docker run --rm -p 8001-8010:8001-8010 kalmhq/echoserver:latest

Test

Before run tests. Upgrade your curl to the lastest version.

Test 8001
# 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
# 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
# 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 installed.

grpcurl -plaintext localhost:8004 main.HelloWorld/Greeting
Test 8005

Please make sure you have grpcurl installed.

grpcurl -insecure localhost:8005 main.HelloWorld/Greeting
Test 8006

Use telnet

telnet localhost 8006

# type something and press enter
# Use ctrl + ] and ctrl + D to exit

Use nc

nc -v localhost 8006

# type something and press enter
# Use ctrl + c to exit
Test 8007

Use nc

nc -uv localhost 8007

# type something and press enter 
# Use ctrl + c to exit

Tag summary

Content type

Image

Digest

Size

8.9 MB

Last updated

almost 6 years ago

docker pull kalmhq/echoserver