https://github.com/bsctl/replyserver
reply web server written in golang
https://github.com/bsctl/replyserver
Last synced: 8 months ago
JSON representation
reply web server written in golang
- Host: GitHub
- URL: https://github.com/bsctl/replyserver
- Owner: bsctl
- Created: 2020-03-12T18:09:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-12T18:09:53.000Z (over 6 years ago)
- Last Synced: 2024-12-27T21:44:45.689Z (over 1 year ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A reply web server for test
The replyserver is a simple web server for test. It returns the client request and its headers.
Usage:
./replyserver -h
-listen string
The address to listen on for http requests (default ":1969")
-listentls string
The address to listen on for https requests (default ":1968")
-cert string
The file name containing a TLS server certificate (default "server.crt")
-key string
The file name containing a TLS server key (default "server.key")
-check string
The address to listen on for healty probes. (default ":1936")
For example:
./replyserver -cert server-tls.crt -key server-tls.key
curl http://macbook.local:1969
Server Name = "MacBook.local"
Client Addr = "127.0.0.1:64349"
Host = "macbook.local:1969"
Method = "GET"
URL = "/"
Protocol = "HTTP/1.1"
+++ Request Headers: +++
Header["Accept"] = ["*/*"]
Header["User-Agent"] = ["curl/7.54.0"]
curl -k https://macbook.local:1968
Server Name = "MacBook.local"
Client Addr = "127.0.0.1:64500"
Host = "macbook.local:1968"
Method = "GET"
URL = "/"
Protocol = "HTTP/2.0"
+++ Request Headers: +++
Header["Accept"] = ["*/*"]
Header["User-Agent"] = ["curl/7.54.0"]
Build and run with Docker:
docker build -t bsctl/replyserver:latest .
docker run -d -p 80:1969 -p 443:1968 -p 8080:1936 \
--name replyserver \
bsctl/replyserver:latest -cert server-tls.crt -key server-tls.key
Deploy on OpenShift:
oc apply -f oscp-deploy.yaml
Deploy on Kubernetes:
kubectl apply -f k8s-deploy.yaml
That's all.