Documentation
¶
Index ¶
- Constants
- func BuildBody(m map[string][]byte) []byte
- func Marshal(m map[string][]byte) []byte
- func NewActionCreate(id, addr string, port uint16, redirect string) map[string][]byte
- func NewActionData(id string, data []byte, redirect string) map[string][]byte
- func NewDelete(id string, redirect string) map[string][]byte
- func NewFullChunkedReadWriter(id string, reqBody io.WriteCloser, serverResp io.ReadCloser) io.ReadWriteCloser
- func NewHalfChunkedReadWriter(ctx context.Context, id string, client *http.Client, method, target string, ...) io.ReadWriteCloser
- func NewHeartbeat(id string, redirect string) map[string][]byte
- func NewHeartbeatRW(rw RawReadWriteCloser, id, redirect string) io.ReadWriteCloser
- func NewRawClient(upstream string, timeout time.Duration) *rawhttp.Client
- func NewSwitchableCookieJar(hintKey []string) http.CookieJar
- func RandString(n int) string
- func Unmarshal(bs []byte) (map[string][]byte, error)
- type ConnectionType
- type RawReadWriteCloser
- type Suo5Client
- type Suo5Conf
- type Suo5Config
- type SwitchableCookieJar
Constants ¶
View Source
const ( HeaderKey = "Content-Type" HeaderValueChecking = "application/plain" HeaderValueFull = "application/octet-stream" HeaderValueHalf = "application/x-binary" )
View Source
const ( ActionCreate byte = 0x00 ActionData byte = 0x01 ActionDelete byte = 0x02 ActionHeartbeat byte = 0x03 )
Variables ¶
This section is empty.
Functions ¶
func NewActionCreate ¶ added in v1.0.0
func NewActionData ¶ added in v1.0.0
func NewFullChunkedReadWriter ¶ added in v1.0.0
func NewFullChunkedReadWriter(id string, reqBody io.WriteCloser, serverResp io.ReadCloser) io.ReadWriteCloser
NewFullChunkedReadWriter 全双工读写流
func NewHalfChunkedReadWriter ¶ added in v1.0.0
func NewHalfChunkedReadWriter(ctx context.Context, id string, client *http.Client, method, target string, serverResp io.ReadCloser, baseHeader http.Header, redirect string) io.ReadWriteCloser
NewHalfChunkedReadWriter 半双工读写流, 用发送请求的方式模拟写
func NewHeartbeatRW ¶ added in v1.0.0
func NewHeartbeatRW(rw RawReadWriteCloser, id, redirect string) io.ReadWriteCloser
func NewRawClient ¶ added in v1.0.0
func NewSwitchableCookieJar ¶ added in v1.0.0
func RandString ¶ added in v1.0.0
Types ¶
type ConnectionType ¶ added in v1.0.0
type ConnectionType string
const ( Undefined ConnectionType = "undefined" AutoDuplex ConnectionType = "auto" FullDuplex ConnectionType = "full" HalfDuplex ConnectionType = "half" )
type RawReadWriteCloser ¶ added in v1.0.0
type RawReadWriteCloser interface {
io.ReadWriteCloser
WriteRaw(p []byte) (n int, err error)
}
type Suo5Client ¶
type Suo5Conf ¶
type Suo5Conf struct {
*Suo5Config
// contains filtered or unexported fields
}
type Suo5Config ¶ added in v1.0.0
type Suo5Config struct {
Method string `json:"method"`
Listen string `json:"listen"`
Target string `json:"target"`
NoAuth bool `json:"no_auth"`
Username string `json:"username"`
Password string `json:"password"`
Mode ConnectionType `json:"mode"`
BufferSize int `json:"buffer_size"`
Timeout int `json:"timeout"`
Debug bool `json:"debug"`
UpstreamProxy string `json:"upstream_proxy"`
Upstream func(ctx context.Context, network, address string) (net.Conn, error)
RedirectURL string `json:"redirect_url"`
RawHeader []string `json:"raw_header"`
DisableHeartbeat bool `json:"disable_heartbeat"`
DisableGzip bool `json:"disable_gzip"`
EnableCookieJar bool `json:"enable_cookiejar"`
ExcludeDomain []string `json:"exclude_domain"`
TestExit string `json:"-"`
ExcludeGlobs []glob.Glob `json:"-"`
Offset int `json:"-"`
Header http.Header `json:"-"`
}
func DefaultSuo5Config ¶ added in v1.0.0
func DefaultSuo5Config() *Suo5Config
func (*Suo5Config) HeaderString ¶ added in v1.0.0
func (s *Suo5Config) HeaderString() string
func (*Suo5Config) Parse ¶ added in v1.0.0
func (s *Suo5Config) Parse() error
type SwitchableCookieJar ¶ added in v1.0.0
func (*SwitchableCookieJar) Cookies ¶ added in v1.0.0
func (f *SwitchableCookieJar) Cookies(u *url.URL) []*http.Cookie
func (*SwitchableCookieJar) SetCookies ¶ added in v1.0.0
func (f *SwitchableCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.