proxy

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrintHeaders added in v0.1.4

func PrettyPrintHeaders(headers http.Header) string

PrettyPrintHeaders formats http.Header into a human-readable string.

func SaveNetworkTraffic added in v0.1.4

func SaveNetworkTraffic(req *http.Request, reqBody []byte, res *http.Response, resBody []byte) (e error)

SaveNetworkTraffic takes an http.Request, its body, http.Response, and response body, maps them to the NetworkTraffic model, and saves it to the database.

func Serve

func Serve(wg *sync.WaitGroup)

Types

type ConnResponseWriter

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

ConnResponseWriter is our custom ResponseWriter that uses net.Conn.

func NewConnResponseWriter

func NewConnResponseWriter(conn net.Conn) *ConnResponseWriter

NewConnResponseWriter creates a new instance of ConnResponseWriter.

func (*ConnResponseWriter) Header

func (cw *ConnResponseWriter) Header() http.Header

Header returns the header map that will be sent by WriteHeader.

func (*ConnResponseWriter) Write

func (cw *ConnResponseWriter) Write(data []byte) (int, error)

Write sends data to the client connection as part of an HTTP response.

func (*ConnResponseWriter) WriteHeader

func (cw *ConnResponseWriter) WriteHeader(statusCode int)

WriteHeader writes the HTTP status code to the client.

Jump to

Keyboard shortcuts

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