httpdumper

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2021 License: MIT Imports: 3 Imported by: 0

README

HTTPDumper

Simple HTTP server that dumps request payloads to stdout

install

go get install github.com/juztin/httpdumper/cmd/httpdumper

serve

httpdumper

httpdumper -addr :4040
httpdumper -addr 0.0.0.0:4040
httpdumper -addr 127.0.0.1:4040
Custom

If you'd like to print some additional, custom information, create a server with

func customFn1(r *http.Request) {
  // Do some custom request printing, like validating API signature, etc.
}

func customFn2(r *http.Request) {
  // More custom stuff
}


h, err := httpdumper.New(customFn1, customFn2)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dumper

type Dumper struct {
	// contains filtered or unexported fields
}

func New

func New(funcs ...RequestFunc) *Dumper

func (*Dumper) ServeHTTP

func (d *Dumper) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RequestFunc

type RequestFunc func(http.ResponseWriter, *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL