proxy

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package proxy 提供应用级别的代理管理 支持三种模式:无代理、系统代理、自定义代理

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager 代理管理器(单例)

func GetManager

func GetManager() *Manager

GetManager 获取代理管理器单例

func (*Manager) GetClient

func (m *Manager) GetClient() *http.Client

GetClient 获取配置好代理的 HTTP Client

func (*Manager) GetClientWithTimeout

func (m *Manager) GetClientWithTimeout(timeout time.Duration) *http.Client

GetClientWithTimeout 获取带自定义超时的 HTTP Client

func (*Manager) GetConfig

func (m *Manager) GetConfig() *models.ProxyConfig

GetConfig 获取当前代理配置

func (*Manager) GetTransport

func (m *Manager) GetTransport() *http.Transport

GetTransport 获取配置好代理的 Transport(用于自定义 Client)

func (*Manager) SetConfig

func (m *Manager) SetConfig(cfg *models.ProxyConfig)

SetConfig 更新代理配置

Jump to

Keyboard shortcuts

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