proxy

package
v0.0.0-nightly.20260806 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureResult

type CaptureResult struct {
	Command any                     `json:"command,omitempty"`
	Flows   []*mitmproxy.FlowRecord `json:"flows"`
}

CaptureResult is returned as tool-result details. FlowRecord is the canonical immutable traffic snapshot from utils/mitmproxy; callers should persist it directly instead of translating it through another flow DTO.

type Command

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

func New

func New(state *State) *Command

func (*Command) Name

func (c *Command) Name() string

func (*Command) Run

func (c *Command) Run(ctx context.Context, execution *commands.Execution) (_ any, err error)

func (*Command) SetCommandExecutor

func (c *Command) SetCommandExecutor(fn CommandExecutor)

func (*Command) SetOnProxyChange

func (c *Command) SetOnProxyChange(fn OnProxyChange)

func (*Command) Usage

func (c *Command) Usage() string

type CommandExecutor

type CommandExecutor func(ctx context.Context, tokens []string, execution *commands.Execution) (any, error)

type Flow

type Flow struct {
	ID               int
	Timestamp        time.Time
	Method           string
	URL              string
	Host             string
	StatusCode       int
	ContentType      string
	Duration         time.Duration
	RequestHeaders   http.Header
	RequestBodySnip  []byte
	ResponseHeaders  http.Header
	ResponseBodySnip []byte
	TLS              bool
	Error            string
}

type FlowStore

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

func NewFlowStore

func NewFlowStore(cap int) *FlowStore

func (*FlowStore) Add

func (s *FlowStore) Add(f Flow)

func (*FlowStore) Clear

func (s *FlowStore) Clear()

func (*FlowStore) Count

func (s *FlowStore) Count() int

func (*FlowStore) Get

func (s *FlowStore) Get(id int) *Flow

func (*FlowStore) Query

func (s *FlowStore) Query(opts QueryOpts) []Flow

type MitmCommand

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

func NewMitmCommand

func NewMitmCommand(reg *commands.CommandRegistry) *MitmCommand

func (*MitmCommand) Name

func (c *MitmCommand) Name() string

func (*MitmCommand) Run

func (c *MitmCommand) Run(ctx context.Context, execution *commands.Execution) (_ any, err error)

func (*MitmCommand) SetCommandExecutor

func (c *MitmCommand) SetCommandExecutor(fn CommandExecutor)

func (*MitmCommand) Usage

func (c *MitmCommand) Usage() string

type OnProxyChange

type OnProxyChange func(newProxyURL string)

type QueryOpts

type QueryOpts struct {
	Host   string
	Status string
	CType  string
	Last   int
}

type State

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

func NewState

func NewState(originalProxy string) *State

func (*State) ActiveNodeName

func (s *State) ActiveNodeName() string

func (*State) ActiveProxy

func (s *State) ActiveProxy() string

func (*State) Clear

func (s *State) Clear()

func (*State) IsAutoMode

func (s *State) IsAutoMode() bool

func (*State) LoadSubscription

func (s *State) LoadSubscription(sub *clash.Subscription, subscribeURL string)

func (*State) Nodes

func (s *State) Nodes() []clash.ProxyNode

func (*State) OriginalProxy

func (s *State) OriginalProxy() string

func (*State) SetAutoDial

func (s *State) SetAutoDial(clashURL string, dial proxyclient.Dial)

func (*State) Switch

func (s *State) Switch(nameOrIndex string) error

func (*State) TestNode

func (s *State) TestNode(ctx context.Context, node *clash.ProxyNode) (time.Duration, error)

Jump to

Keyboard shortcuts

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