agent

package
v0.0.0-...-1d1e8cc Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

type ConsolePrinter

type ConsolePrinter struct{}

ConsolePrinter 将*http.Request打印到控制台

func (ConsolePrinter) Handle

func (cp ConsolePrinter) Handle(req *http.Request)

Handle ConsolePrinter实现的RequestHandle

type Redirector

type Redirector struct {
	Src string // eg. test.example.com:81
	Dst string // eg. https://stage.example.com:90/asdx123
}

Redirector 实现将*http.Request转发到目标服务器

func (*Redirector) Handle

func (red *Redirector) Handle(req *http.Request)

Handle *Redirector实现的RequestHandle

type RequestHandle

type RequestHandle func(r *http.Request)

RequestHandle 声明处理*http.Request对象的方法类型

type SniffTask

type SniffTask struct {
	D time.Duration
	// contains filtered or unexported fields
}

SniffTask 监听任务对象,包含监听、采集(处理)部分

func NewSniffTask

func NewSniffTask(ip string, port int, d time.Duration, h ...RequestHandle) (*SniffTask, error)

NewSniffTask SniffTask工厂函数

func (*SniffTask) Sniff

func (st *SniffTask) Sniff() error

Sniff SniffTask任务开始

func (*SniffTask) Stop

func (st *SniffTask) Stop()

Stop 停止嗅探任务,包括停止嗅探、采集处理

func (*SniffTask) WithHandle

func (st *SniffTask) WithHandle(h ...RequestHandle)

WithHandle 绑定RequestHandle,用来处理采集到*http.Request对象

Jump to

Keyboard shortcuts

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