proxy

package
v0.0.0-nightly.20260629 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func New

func New(state *State) *Command

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, args []string) error

func (*Command) Name

func (c *Command) Name() string

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) (string, error)

type Flow added in v0.2.7

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 added in v0.2.7

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

func NewFlowStore added in v0.2.7

func NewFlowStore(cap int) *FlowStore

func (*FlowStore) Add added in v0.2.7

func (s *FlowStore) Add(f Flow)

func (*FlowStore) Clear added in v0.2.7

func (s *FlowStore) Clear()

func (*FlowStore) Count added in v0.2.7

func (s *FlowStore) Count() int

func (*FlowStore) Get added in v0.2.7

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

func (*FlowStore) Query added in v0.2.7

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

type MitmCommand added in v0.2.7

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

func NewMitmCommand added in v0.2.7

func NewMitmCommand(reg *commands.CommandRegistry) *MitmCommand

func (*MitmCommand) Execute added in v0.2.7

func (c *MitmCommand) Execute(ctx context.Context, args []string) error

func (*MitmCommand) Name added in v0.2.7

func (c *MitmCommand) Name() string

func (*MitmCommand) SetCommandExecutor added in v0.2.7

func (c *MitmCommand) SetCommandExecutor(fn func(ctx context.Context, tokens []string) (string, error))

func (*MitmCommand) Usage added in v0.2.7

func (c *MitmCommand) Usage() string

type OnProxyChange

type OnProxyChange func(newProxyURL string)

type QueryOpts added in v0.2.7

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