All Projects → mendhak → Docker Http Https Echo

mendhak / Docker Http Https Echo

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

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Docker Http Https Echo

Sites Using Cloudflare
💔 Archived list of domains using Cloudflare DNS at the time of the CloudBleed announcement.
Stars: ✭ 1,914 (+886.6%)
Mutual labels:  https
Partyloud
A simple tool to generate fake web browsing and mitigate tracking
Stars: ✭ 170 (-12.37%)
Mutual labels:  https
Simple Web Server
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
Stars: ✭ 2,261 (+1065.46%)
Mutual labels:  https
Esp8266 Iot Framework
Framework for IoT projects implementing HTTPS requests, a React web interface, WiFi manager, live dashboard, configuration manager, file manager and OTA updates.
Stars: ✭ 165 (-14.95%)
Mutual labels:  https
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+1629.38%)
Mutual labels:  https
Guacamole Install Rhel 7
Apache Guacamole installation bash script for RHEL 7 and CentOS 7 including options for Nginx, HTTPS, SSL, LDAP, Let's Encrypt certificates and more
Stars: ✭ 174 (-10.31%)
Mutual labels:  https
Shcheck
A basic tool to check security headers of a website
Stars: ✭ 160 (-17.53%)
Mutual labels:  https
Actionhero
Actionhero is a realtime multi-transport nodejs API Server with integrated cluster capabilities and delayed tasks
Stars: ✭ 2,280 (+1075.26%)
Mutual labels:  https
Nginx Admins Handbook
How to improve NGINX performance, security, and other important things.
Stars: ✭ 12,463 (+6324.23%)
Mutual labels:  https
Fq Book
📖《这本书能让你连接互联网》详细阐述代理、隧道、VPN运作过程,并对GFW策略如:地址端口封锁、服务器缓存投毒、数字验证攻击、SSL连接阻断做相关的原理说明
Stars: ✭ 2,393 (+1133.51%)
Mutual labels:  https
Lear
Linux Engine for Asset Retrieval - speed-profiled C HTTP server
Stars: ✭ 165 (-14.95%)
Mutual labels:  https
Mutual Tls Ssl
🔐 Tutorial of setting up Security for your API with one way authentication with TLS/SSL and mutual mutual authentication for a java based web server and a client with both Spring Boot. Different clients are provided such as Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient, the old and the new Jersey Client, Google HttpClient, Unirest, Retrofit, Feign, Methanol, vertx, Scala client Finagle, Featherbed, Dispatch Reboot, AsyncHttpClient, Sttp, Akka, Requests Scala, Http4s Blaze, Kotlin client Fuel, http4k, Kohttp and ktor. Also other server examples are available such as jersey with grizzly. Also gRPC examples are included
Stars: ✭ 163 (-15.98%)
Mutual labels:  https
Badssl.com
🔒 Memorable site for testing clients against bad SSL configs.
Stars: ✭ 2,234 (+1051.55%)
Mutual labels:  https
Haproxy
HAProxy Load Balancer's development branch (mirror of git.haproxy.org)
Stars: ✭ 2,463 (+1169.59%)
Mutual labels:  https
Hrshell
HRShell is an HTTPS/HTTP reverse shell built with flask. It is an advanced C2 server with many features & capabilities.
Stars: ✭ 193 (-0.52%)
Mutual labels:  https
Esp32 https server
Alternative ESP32 Webserver implementation for the ESP32 Arduino Core, supporting HTTPS and HTTP.
Stars: ✭ 162 (-16.49%)
Mutual labels:  https
Crest
HTTP and REST client for Crystal
Stars: ✭ 174 (-10.31%)
Mutual labels:  https
Httpcanary
A powerful capture and injection tool for the Android platform
Stars: ✭ 2,188 (+1027.84%)
Mutual labels:  https
Lonely Shell
poc https reverse shell
Stars: ✭ 193 (-0.52%)
Mutual labels:  https
Http2 Wrapper
Use HTTP2 the same way like HTTP1
Stars: ✭ 183 (-5.67%)
Mutual labels:  https

pulls Docker Image Version (latest semver) GitHub Workflow Status

mendhak/http-https-echo is a Docker image that can echo various HTTP request properties back to client, as well as in the Docker container logs. You can use your own certificates, choose your ports, decode JWT headers and filter out certain paths.

browser

This image is executed as non root by default and is fully compliant with Kubernetes or Openshift deployment.

Please do not use the :latest tag as it will break without warning, use a specific version instead.

Basic Usage

Run with Docker

docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:18

Or run with Docker Compose

docker-compose up

Then, issue a request via your browser or curl, and watch the response, as well as container log output.

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

Choose your ports

You can choose a different internal port instead of 8080 and 8443 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:18

With docker compose, this would be:

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

Use your own certificates

Use volume mounting to substitute the certificate and private key with your own. This example uses the snakeoil cert.

my-http-listener:
    image: mendhak/http-https-echo:18
    ports:
        - "8080:8080"
        - "8443:8443"
    volumes:
        - /etc/ssl/certs/ssl-cert-snakeoil.pem:/app/fullchain.pem
        - /etc/ssl/private/ssl-cert-snakeoil.key:/app/privkey.pem

Decode JWT header

If you specify the header that contains the JWT, the echo output will contain the decoded JWT. Use the JWT_HEADER environment variable for this.

docker run -e JWT_HEADER=Authentication -p 8080:8080 -p 8443:8443 --rm -it mendhak/http-https-echo:18

Now make your request with Authentication: eyJ... header (it should also work with the Authentication: Bearer eyJ... schema too):

 curl -k -H "Authentication: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" http://localhost:8080/

And in the output you should see a jwt section.

Do not log specific path

Set the environment variable LOG_IGNORE_PATH to a path you would like to exclude from verbose logging to stdout. This can help reduce noise from healthchecks in orchestration/infrastructure like Swarm, Kubernetes, ALBs, etc.

 docker run -e LOG_IGNORE_PATH=/ping -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:18

With docker compose, this would be:

my-http-listener:
    image: mendhak/http-https-echo:18
    environment:
        - LOG_IGNORE_PATH=/ping
    ports:
        - "8080:8080"
        - "8443:8443"

JSON payloads and JSON output

If you submit a JSON payload in the body of the request, with Content-Type: application/json, then the response will contain the escaped JSON as well.

For example,

curl -X POST -H "Content-Type: application/json" -d '{"a":"b"}' http://localhost:8080/

Will contain a json property in the response/output.

    ...
    "xhr": false,
    "connection": {},
    "json": {
        "a": "b"
    }
}

Custom status code

Use x-set-response-status-code to set a custom status code. For example,

curl -v -H "x-set-response-status-code: 401" http://localhost:8080/

Will cause the reponse status code to be:

 HTTP/1.1 401 Unauthorized

Add a delay before response

Use x-set-response-delay-ms to set a custom delay in milliseconds. This will allow you to simulate slow responses.

curl -v -H "x-set-response-delay-ms: 6000" http://localhost:8080/

Output

Curl output

curl

docker logs output

dockerlogs

Building

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

Run some tests to make sure features are working as expected.

./tests.sh

To create a new image on Docker Hub, I need to create a tag and push it.

git tag -s 16
git push --tags

Changelog

See the changelog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].