Sign inSign up

pahud/echo-http-request

By pahud

Updated about 7 years ago

Simple HTTP service that echo back the request info to the client

Image
0

806

pahud/echo-http-request repository overview

echo-http-request

This is a simple HTTP service that echo back the request info to the client. A simple debugging tool in some container environment.

Run the service(Golang implementation)

# start the service with docker in the foreground
$ docker run -i -p 8080:8080 pahud/echo-http-request:latest
# switch to another terminal and test it with cURL
$ curl -s localhost:8080 | jq
{
  "body": "",
  "headers": {
    "accept": "*/*",
    "host": "localhost:8080",
    "user-agent": "curl/7.61.1"
  },
  "host": "localhost:8080",
  "httpMethod": "GET",
  "path": "/",
  "queryStringParameters": {},
  "uri": "/"
}

You will see the header, host and uri in the response JSON.

Run the service(OpenResty implementation)

You may also run it with OpenResty

# OpenResty
$ docker run -i -p 8080:80 pahud/echo-http-request:openresty
# switch to another terminal and test it with cURL
$ curl -s localhost:8080 | jq
{
  "queryStringParameters": {},
  "path": "/",
  "httpMethod": "GET",
  "headers": {
    "host": "localhost:8080",
    "accept": "*/*",
    "user-agent": "curl/7.61.1"
  },
  "body": ""
}

Tag summary

Content type

Image

Digest

Size

10.4 MB

Last updated

over 7 years ago

docker pull pahud/echo-http-request