proxy

package
v0.0.0-...-8371aea Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package proxy provide NaughtyProxy as a HTTP reverse proxy that can connects to both http/https backend server. It uses hooked print function to print http(s) request/response. It also provides a call back function that provide a method modifying the original request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NaughtyProxy

type NaughtyProxy struct {
	// ReverseProxy is inherited for using it's functions such as
	// Director and Transport
	*httputil.ReverseProxy
	// Backend is the backend server parsed in URL format
	Backend *url.URL
	// Speaker is a Render interface for printing http request/response
	Speaker speakhttp.Render
	// Callback is a function to modify outgoing http request
	// You can process the outgoing request based on incoming one
	Callback func(inReq, outReq *http.Request)
}

NaughtyProxy is a reverse proxy server that acting as man-in-the-middle and printing http request/response for debugging purposes

func (*NaughtyProxy) ServeHTTP

func (p *NaughtyProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP is the HTTP handler function.

Jump to

Keyboard shortcuts

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