server

package
v0.0.0-...-63d9018 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LsServer

type LsServer struct {
	Cipher     *lightsocks.Cipher
	ListenAddr *net.TCPAddr
}

func NewLsServer

func NewLsServer(password string, listenAddr string) (*LsServer, error)

新建一个服务端 服务端的职责是: 1. 监听来自本地代理客户端的请求 2. 解密本地代理客户端请求的数据,解析 SOCKS5 协议,连接用户浏览器真正想要连接的远程服务器 3. 转发用户浏览器真正想要连接的远程服务器返回的数据的加密后的内容到本地代理客户端

func (*LsServer) Listen

func (lsServer *LsServer) Listen(didListen func(listenAddr *net.TCPAddr)) error

运行服务端并且监听来自本地代理客户端的请求

Jump to

Keyboard shortcuts

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