tcpproxy

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

简介

一个tcp通道 加密复用的程序

服务端运行

./socks5proxy -s -port 18889 -ps 123456 -addr=127.0.0.1:7891

客户端

./socks5proxy -port 18889 -ps 123456 -addr serverhost:18889

Documentation

Index

Constants

View Source
const (
	RANDOM_A = 13
	RANDOM_B = 7
	RANDOM_M = 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (Client) New

func (Client) New(pass, serverAddr, lAddr string) *Client

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (c *Client) Stop() error

type DefaultAuth

type DefaultAuth struct {
	Encode *[256]byte //编码表
	Decode *[256]byte //解码表
	// contains filtered or unexported fields
}

func CreateRandomCipher

func CreateRandomCipher(conn net.Conn, passwd string) (*DefaultAuth, error)

func CreateSimpleCipher

func CreateSimpleCipher(passwd string) (*DefaultAuth, error)

func (*DefaultAuth) Close

func (s *DefaultAuth) Close() error

func (*DefaultAuth) DecodeRead

func (s *DefaultAuth) DecodeRead(c io.ReadWriter, b []byte) (int, error)

func (*DefaultAuth) Decrypt

func (s *DefaultAuth) Decrypt(b []byte) error

func (*DefaultAuth) EncodeWrite

func (s *DefaultAuth) EncodeWrite(c io.ReadWriter, b []byte) (int, error)

func (*DefaultAuth) Encrypt

func (s *DefaultAuth) Encrypt(b []byte) error

func (*DefaultAuth) Read

func (s *DefaultAuth) Read(p []byte) (n int, err error)

func (*DefaultAuth) Write

func (s *DefaultAuth) Write(p []byte) (n int, err error)

type Server

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

func (Server) New

func (Server) New(sPass, dstAddr, listenAddr string) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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