proxy

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: AGPL-3.0 Imports: 18 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)

CommandExecutor executes a named command with args. Matches CommandRegistry.ExecuteArgs.

type OnProxyChange

type OnProxyChange func(newProxyURL string)

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