Categorygithub.com/sshilin/microbin
modulepackage
0.3.0
Repository: https://github.com/sshilin/microbin.git
Documentation: pkg.go.dev

# README

Build Go Report Card Coverage Status

Microbin accepts any HTTP request and returns the request's details including headers, parameters, query strings in JSON format. It is designed to gain insights into how requests are processed and modified as they traverse a cluster environment.

Running with Docker

docker run --name microbin -p 8080:8080 ghcr.io/sshilin/microbin:latest

Running with kubectl

git clone https://github.com/sshilin/microbin.git && cd microbin
kubectl apply -f k8s/microbin.yaml

Running with Helm

helm repo add microbin https://sshilin.github.io/microbin
helm install --generate-name  microbin/microbin

Usage

Note: GET /metrics is reserved for Prometheus metrics

HTTP/1.1:

$ curl http://localhost:8080/microbin/headers

HTTP/2:

$ curl --http2 --cacert ./cert/cert.pem https://localhost/microbin/headers

HTTP/2 Cleartext (H2C):

$ curl --http2-prior-knowledge http://localhost:8080/headers

Example response:

{
  "host": "microbin-6865c46f94-gpbsj",
  "remote": "10.1.0.1:51346",
  "proto": "HTTP/1.1",
  "method": "GET",
  "uri": "/headers",
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip",
    "User-Agent": "curl/7.87.0",
    "X-Forwarded-For": "127.0.0.1, 127.0.0.1",
    "X-Forwarded-Uri": "/api/v1/namespaces/default/services/microbin:8080/proxy/headers"
  }
}

Configuration

KeyDescriptionDefault
LISTENListen on host:port0.0.0.0:8080
TLS_ENABLEDEnable TLSfalse
TLS_KEY_FILETLS key filepath""
TLS_CERT_FILETLS cert filepath""
LOG_FORMAT_JSONEnable structured logsfalse

HTTPS Examples

docker run --name microbin -p 8080:8080 \
  -v $(pwd)/cert:/var/cert:ro \
  -e TLS_ENABLED=true \
  -e TLS_KEY_FILE=/var/cert/key.pem \
  -e TLS_CERT_FILE=/var/cert/cert.pem \
  ghcr.io/sshilin/microbin:latest
kubectl create secret generic microbin-cert --from-file=./cert
kubectl apply -f k8s/microbin-https.yaml

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Structs

No description provided by the author
No description provided by the author