Documentation ¶
Overview ¶
Package simplesocks implements SimpleSocks protocol for proxy.Server and proxy.Client.
See https://p4gefau1t.github.io/trojan-go/developer/simplesocks/
Index ¶
- Constants
- func GetAddrFrom(buf utils.ByteReader) (addr netLayer.Addr, err error)
- func WriteAddrToBuf(target netLayer.Addr, buf *bytes.Buffer)
- type Client
- type ClientCreator
- type Server
- type ServerCreator
- type TCPConn
- func (c *TCPConn) CanSplice() (r bool, conn net.Conn)
- func (c *TCPConn) EverPossibleToSplice() bool
- func (c *TCPConn) Read(p []byte) (int, error)
- func (c *TCPConn) ReadFrom(r io.Reader) (written int64, err error)
- func (c *TCPConn) Write(p []byte) (int, error)
- func (c *TCPConn) WriteBuffers(buffers [][]byte) (int64, error)
- type UDPConn
Constants ¶
View Source
const ( // trojan-go 的代码里,这里依然叫做connect和associate,而实际上,因为通道已经建立,所以实际含义已经不同 // 这些命令只用于指示承载数据的传输层协议,所以我们这里重命名一下。 CmdTCP = 0x01 CmdUDP = 0x03 ATypIP4 = 0x1 ATypDomain = 0x3 ATypIP6 = 0x4 Name = "simplesocks" )
Variables ¶
This section is empty.
Functions ¶
func GetAddrFrom ¶
func GetAddrFrom(buf utils.ByteReader) (addr netLayer.Addr, err error)
依照trojan协议的格式读取 地址的域名、ip、port信息
Types ¶
type Server ¶
implements proxy.Server
func (*Server) CanFallback ¶ added in v1.2.1
type ServerCreator ¶
type ServerCreator struct{}
func (ServerCreator) NewServer ¶
func (ServerCreator) NewServer(lc *proxy.ListenConf) (proxy.Server, error)
func (ServerCreator) URLToListenConf ¶ added in v1.2.4
func (ServerCreator) URLToListenConf(u *url.URL, lc *proxy.ListenConf, format int) (*proxy.ListenConf, error)
type TCPConn ¶
func (*TCPConn) EverPossibleToSplice ¶
type UDPConn ¶
func (*UDPConn) CloseConnWithRaddr ¶
Click to show internal directories.
Click to hide internal directories.