Need help with httpmole?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jcchavezs
131 Stars 4 Forks 37 Commits 6 Opened issues

Description

A HTTP mole service

Services available

!
?

Need anything else?

Contributors list

# 45,223
zipkin
Go
Applica...
golang
30 commits

httpmole

Build Status

httpmole provides a HTTP mock server that will act as a mole among your services, telling you everything http clients send to it and responding them whatever you want it to respond. Just like an actual mole.

Features:

  • Use
    response-status
    and
    response-header
    to quickly spin up a http server.
  • Use
    response-file
    to modify the response in real time using a text editor.
  • Use
    response-from
    to act as a proxy and be able to inspect the request/response going to a given service.

Install

go install github.com/jcchavezs/httpmole/cmd/httpmole

Usage

Using the binary

httpmole -p=8082 -response-status=200

or using a response file:

httpmole -p=8082 -response-file=./myresponse.json
// myresponse.json
{
    "status_code": 200,
    "headers": {
        "content-type": "application/json"
    },
    "body": {
        "message": "I am real"
    }
}

or proxying a service to inspect the incoming requests:

httpmole -p=8082 -response-from=therealservice:8082

Using docker

docker run -p "10080:10080" jcchavezs/httpmole -response-status=201

or pass a response file over volumes

docker run -p "10080:10080" -v `pwd`/response.json:/httpmole/response.json jcchavezs/httpmole -response-file=/httpmole/response.json

Docker image is hosted in dockerhub

httpmole is heavily inspired by httplab

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.