Documentation ¶
Overview ¶
Package simplesocks implements SimpleSocks protocol. 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 (uc *TCPConn) Read(p []byte) (int, error)
- func (c *TCPConn) ReadFrom(r io.Reader) (written int64, err error)
- func (uc *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 Client ¶
type Client struct {
proxy.ProxyCommonStruct
}
func (*Client) EstablishUDPChannel ¶
type ClientCreator ¶
type ClientCreator struct{}
func (ClientCreator) NewClientFromURL ¶
type Server ¶
type Server struct {
proxy.ProxyCommonStruct
}
implements proxy.Server
type ServerCreator ¶
type ServerCreator struct{}
func (ServerCreator) NewServer ¶
func (ServerCreator) NewServer(lc *proxy.ListenConf) (proxy.Server, error)
func (ServerCreator) NewServerFromURL ¶
type TCPConn ¶
func (*TCPConn) EverPossibleToSplice ¶
Click to show internal directories.
Click to hide internal directories.