Documentation ¶
Index ¶
- type SocksLocalRouter
- func (s *SocksLocalRouter) AddSocks5Proxy(endpoint *string, protocol SupportedProtocols, start bool, login *string, ...) (int, error)
- func (s *SocksLocalRouter) AssociateProcessNameToProxy(processName string, proxyID int) error
- func (s *SocksLocalRouter) Close() error
- func (s *SocksLocalRouter) GetProxyPortTCP(process *N.NetworkProcess) uint16
- func (s *SocksLocalRouter) IsDriverLoaded() bool
- func (s *SocksLocalRouter) IsTCPProxyPort(port uint16) bool
- func (s *SocksLocalRouter) Start() error
- func (s *SocksLocalRouter) Stop() error
- type SupportedProtocols
- type TransparentProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SocksLocalRouter ¶
type SocksLocalRouter struct { sync.Mutex // Mutex to synchronize access to shared resources. *A.NdisApi // API instance for interacting with the NDIS API. // contains filtered or unexported fields }
SocksLocalRouter handles the routing of SOCKS traffic locally.
func NewSocksLocalRouter ¶
func NewSocksLocalRouter(api *A.NdisApi) (*SocksLocalRouter, error)
NewSocksLocalRouter creates a new instance of SocksLocalRouter.
func (*SocksLocalRouter) AddSocks5Proxy ¶
func (s *SocksLocalRouter) AddSocks5Proxy(endpoint *string, protocol SupportedProtocols, start bool, login *string, password *string) (int, error)
AddSocks5Proxy adds a new SOCKS5 proxy to the router.
func (*SocksLocalRouter) AssociateProcessNameToProxy ¶
func (s *SocksLocalRouter) AssociateProcessNameToProxy(processName string, proxyID int) error
AssociateProcessNameToProxy associates a process name with a proxy ID.
func (*SocksLocalRouter) Close ¶
func (s *SocksLocalRouter) Close() error
Close stops the router and resets the static filter.
func (*SocksLocalRouter) GetProxyPortTCP ¶
func (s *SocksLocalRouter) GetProxyPortTCP(process *N.NetworkProcess) uint16
GetProxyPortTCP retrieves the TCP proxy port for a given process.
func (*SocksLocalRouter) IsDriverLoaded ¶
func (s *SocksLocalRouter) IsDriverLoaded() bool
IsDriverLoaded checks if the NDIS driver is loaded.
func (*SocksLocalRouter) IsTCPProxyPort ¶
func (s *SocksLocalRouter) IsTCPProxyPort(port uint16) bool
IsTCPProxyPort checks if a given port is used by any TCP proxy.
func (*SocksLocalRouter) Start ¶
func (s *SocksLocalRouter) Start() error
Start activates the router and its proxy servers.
func (*SocksLocalRouter) Stop ¶
func (s *SocksLocalRouter) Stop() error
Stop deactivates the router and its proxy servers.
type SupportedProtocols ¶
type SupportedProtocols int
SupportedProtocols defines the supported protocols for the proxy.
const ( TCP SupportedProtocols = iota UDP Both )
type TransparentProxy ¶
type TransparentProxy struct {
// contains filtered or unexported fields
}
TransparentProxy represents a transparent proxy server.
func NewTransparentProxy ¶
func NewTransparentProxy(localProxyPort uint16, socksEndpoint string, socksUsername, socksPassword string, queryRemotePeer queryRemotePeer) *TransparentProxy
NewTransparentProxy creates a new instance of TransparentProxy.
func (*TransparentProxy) GetLocalProxyPort ¶
func (tp *TransparentProxy) GetLocalProxyPort() uint16
GetLocalProxyPort returns the local proxy port.
func (*TransparentProxy) Start ¶
func (tp *TransparentProxy) Start(ctx context.Context) error
Start starts the transparent proxy server.
func (*TransparentProxy) Stop ¶
func (tp *TransparentProxy) Stop()
Stop stops the transparent proxy server.