GoProxy

package module
v0.0.0-...-520d599 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 10 Imported by: 0

README

GoProxy

项目可以使用部署在服务端和客户端的两个进程,完成流量的代理

配置文件当中可以配置多种流量代理的加密方式和秘钥,让流量失去特征

启动命令
# 服务器端启动
./main -s

# 客户端启动
./main -b

如果有任何问题,可以联系 baymaxrice@gmail.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// 数据转换器
	Converter convertor.Convertor

	// 本地服务地址
	LocalAddr *net.TCPAddr `json:"local_addr"`

	// 服务器地址
	ServerAddr *net.TCPAddr `json:"server_addr"`
}

func (*Client) DecodeCopy

func (c *Client) DecodeCopy(src *net.TCPConn, dst *net.TCPConn) error

func (*Client) DecodeRead

func (c *Client) DecodeRead(con *net.TCPConn, bs []byte) (n int, err error)

func (*Client) EncodeCopy

func (c *Client) EncodeCopy(src *net.TCPConn, dst *net.TCPConn) error

EncodeCopy 从src中源源不断的读取原数据加密后写入到dst,直到src中没有数据可以再读取

func (*Client) EncodeWrite

func (c *Client) EncodeWrite(con *net.TCPConn, bs []byte) (int, error)

func (*Client) LoadConf

func (c *Client) LoadConf(confPath string) error

func (*Client) Run

func (c *Client) Run() error

type ClientConf

type ClientConf struct {
	LocalAddr  addr            `toml:"local_addr"`  // 本地服务地址
	ServerAddr addr            `toml:"server_addr"` // 服务器地址
	Convertor  ClientConvertor `toml:"convertor"`   // 加密方式
}

type ClientConvertor

type ClientConvertor struct {
	Mode     string `toml:"mode"`
	Password string `toml:"password"`
}

type Server

type Server struct {
	// 数据转换器
	Converter convertor.Convertor

	// 本地服务地址
	LocalAddr *net.TCPAddr
}

func (*Server) DecodeCopy

func (s *Server) DecodeCopy(src *net.TCPConn, dst *net.TCPConn) error

func (*Server) DecodeRead

func (s *Server) DecodeRead(con *net.TCPConn, bs []byte) (n int, err error)

func (*Server) EncodeCopy

func (s *Server) EncodeCopy(src *net.TCPConn, dst *net.TCPConn) error

从src中源源不断的读取原数据加密后写入到dst,直到src中没有数据可以再读取

func (*Server) EncodeWrite

func (s *Server) EncodeWrite(con *net.TCPConn, bs []byte) (int, error)

func (*Server) LoadConf

func (s *Server) LoadConf(confPath string) error

func (*Server) Run

func (s *Server) Run() error

type ServerConf

type ServerConf struct {
	// 本地服务地址
	LocalAddr addr            `toml:"local_addr"`
	Convertor ServerConvertor `toml:"convertor"`
}

type ServerConvertor

type ServerConvertor struct {
	Mode     string `toml:"mode"`
	Password string `toml:"password"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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