Skip to content
forked from attiand/http-echo

Simple server image that list information about the request in the response body

Notifications You must be signed in to change notification settings

erilor/http-echo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-echo

Simple server image that list information about the request in the response body. Note that header names are in canonical case.

Run

docker run -it --rm -e NAME=server1 -p 8080:8080 ghcr.io/attiand/http-echo:latest

Test

curl http://localhost:8080 | jq .

{
  "name": "server1",
  "request": {
    "url": "/",
    "method": "GET",
    "headers": {
      "Accept": [
        "*/*"
      ],
      "User-Agent": [
        "curl/7.76.1"
      ]
    }
  }
}

Set Cookies

curl -I -c cookies http://localhost:8080/setcookie?JSESSIONID=ABC123

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=ABC123
Date: Fri, 21 Apr 2023 11:36:48 GMT

curl -b cookies http://localhost:8080 | jq .

{
  "name": "server1",
  "request": {
    "url": "/",
    "method": "GET",
    "headers": {
      "Accept": [
        "*/*"
      ],
      "Cookie": [
        "JSESSIONID=ABC123"
      ],
      "User-Agent": [
        "curl/7.87.0"
      ]
    }
  }
}

Optional environment variables

  • NAME - Specify a server name added to the response body

About

Simple server image that list information about the request in the response body

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 80.8%
  • Dockerfile 19.2%