Sign inSign up

junchaw/ecko

By junchaw

•Updated over 1 year ago

HTTP echo server that returns and logs all request details for debugging.

Image
1

663

junchaw/ecko repository overview

⁠ECKO

https://github.com/junchaw/ecko⁠

Docker Pulls Build Status

HTTP echo server that returns and logs all request details for debugging.

Why not traefik/whoami⁠? Because ecko logs request details, I find it extremely useful when developing webhooks where I want to know what's being sent to me.

⁠Usage

Run the server:

docker run -p 8080:8080 junchaw/ecko -h
docker run -p 8080:8080 junchaw/ecko
⁠Endpoints
/

Print help.

⁠/echo

Print echo response.

Sample response:

Status: 200
Hostname: 8de1402a4966
Name: ecko
RemoteAddr: 172.17.0.1:33746
IP[0]: 127.0.0.1
IP[1]: ::1
IP[2]: 172.17.0.2
Method: POST
URL: /echo
Host: localhost:8080

Headers:
Accept: */*
Postman-Token: 5e92276c-6950-4838-9f1f-bb9a0ef0186f
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 13
Content-Type: application/json
User-Agent: PostmanRuntime/7.43.3

Request Body:
{"hello":"world"}
⁠/api

Print echo response as JSON.

Sample response:

{
    "hostname": "8de1402a4966",
    "ip": [
        "127.0.0.1",
        "::1",
        "172.17.0.2"
    ],
    "headers": {
        "Accept": [
            "*/*"
        ],
        "Accept-Encoding": [
            "gzip, deflate, br"
        ],
        "Connection": [
            "keep-alive"
        ],
        "Content-Length": [
            "13"
        ],
        "Content-Type": [
            "application/json"
        ],
        "Postman-Token": [
            "39248df1-7ed4-4a90-887a-68f431aa7223"
        ],
        "User-Agent": [
            "PostmanRuntime/7.43.3"
        ]
    },
    "url": "/api",
    "host": "localhost:8080",
    "method": "POST",
    "name": "ecko",
    "remoteAddr": "172.17.0.1:33746",
    "requestBody": "{\"hello\":\"world\"}"
}
⁠/status/{code}

Return the specified HTTP status code.

⁠Deploy

Kubernetes:

kubectl apply -f deploy/kubernetes-deploy-example.yaml

Tag summary

Content type

Image

Digest

sha256:cc64ab186…

Size

5.9 MB

Last updated

over 1 year ago

docker pull junchaw/ecko