Skip to content

Docker image that echoes request data as JSON; listens on HTTP/S, useful for debugging.

Notifications You must be signed in to change notification settings

cexiolabs/docker-http-https-echo

 
 

Repository files navigation

Docker image which echoes various HTTP request properties back to client, as well as in docker logs.

browser

Usage

docker run --publish 8080:80 --publish 8443:443 --rm --tty cexiolabs/http-https-echo

docker run --publish 8080:8888 --publish 8443:9999 --volume /my/ssl/path:/etc/ssl --env HTTP_PORT=8888 HTTPS_PORT=9999 --env --env SSL_CERT_FILE=/etc/ssl/mycert.pem --env SSL_KEY_FILE=/etc/ssl/mycert.key --rm --tty cexiolabs/http-https-echo

Then issue a request via your browser or curl -

curl -k -X PUT -H "Arbitrary:Header" -d aaa=bbb https://localhost:8443/hello-world

Docker Compose

You can substitute the certificate and private key with your own. This example uses the snakeoil cert.

my-http-listener:
    image: cexiolabs/http-https-echo
    ports:
        - "8080:8888"
        - "8443:9999"
    environment:
        - SSL_CERT_FILE=/etc/ssl/mycert.pem
        - SSL_KEY_FILE=/etc/ssl/mycert.key
        - HTTP_PORT=8888
        - HTTPS_PORT=9999
    volumes:
        - /my/ssl/path:/etc/ssl

Output

Curl output

curl

docker logs output

dockerlogs

Building

docker build --tag cexiolabs/http-https-echo .

About

Docker image that echoes request data as JSON; listens on HTTP/S, useful for debugging.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.9%
  • Shell 29.3%
  • Dockerfile 7.8%