Giter Club home page Giter Club logo

docker-http-https-echo's Introduction

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

browser

Usage

docker run -p 8080:80 -p 8443:443 --rm -t mendhak/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: mendhak/http-https-echo
    ports:
        - "8080:80"
        - "8443:443"
    volumes:
        - /etc/ssl/certs/ssl-cert-snakeoil.pem:/app/fullchain.pem
        - /etc/ssl/private/ssl-cert-snakeoil.key:/app/privkey.pem

Choose your ports

You can choose a different internal port instead of 80 and 443 with the HTTP_PORT and HTTPS_PORT environment variables.

In this example I'm setting http to listen on 8888, and https to listen on 9999.

 docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo

With docker compose, this would be

my-http-listener:
    image: mendhak/http-https-echo
    environment: 
        - HTTP_PORT=8888
        - HTTPS_PORT=9999
    ports:
        - "8080:8888"
        - "8443:9999"

Output

Curl output

curl

docker logs output

dockerlogs

Building

docker build -t mendhak/http-https-echo .

docker-http-https-echo's People

Contributors

kurounin avatar marcinfalkowski avatar mendhak avatar solsson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.