Documentation ¶
Index ¶
- Constants
- 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 NewHeartbeatRW(rw RawReadWriteCloser, id, redirect string) io.ReadWriteCloser
- func NewSwitchableCookieJar(hintKey []string) http.CookieJar
- func RandString(n int) string
- func Run(ctx context.Context, config *Suo5Config) error
- type ClientConnectCloseEvent
- type ClientConnectionEvent
- type ClientEventHandler
- type ConnectedEvent
- type ConnectionType
- type RawReadWriteCloser
- 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 NewFullChunkedReadWriter ¶
func NewFullChunkedReadWriter(id string, reqBody io.WriteCloser, serverResp io.ReadCloser) io.ReadWriteCloser
NewFullChunkedReadWriter 全双工读写流
func NewHalfChunkedReadWriter ¶
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 v0.7.0
func NewHeartbeatRW(rw RawReadWriteCloser, id, redirect string) io.ReadWriteCloser
func NewSwitchableCookieJar ¶ added in v1.3.1
func RandString ¶
Types ¶
type ClientConnectCloseEvent ¶
type ClientConnectionEvent ¶
type ClientEventHandler ¶
type ClientEventHandler struct { Inner server.Handler OnNewClientConnection func(event *ClientConnectionEvent) OnClientConnectionClose func(event *ClientConnectCloseEvent) }
type ConnectedEvent ¶
type ConnectedEvent struct {
Mode ConnectionType `json:"mode"`
}
type ConnectionType ¶
type ConnectionType string
const ( Undefined ConnectionType = "undefined" AutoDuplex ConnectionType = "auto" FullDuplex ConnectionType = "full" HalfDuplex ConnectionType = "half" )
type RawReadWriteCloser ¶ added in v0.7.0
type RawReadWriteCloser interface { io.ReadWriteCloser WriteRaw(p []byte) (n int, err error) }
type Suo5Config ¶
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"` 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:"-"` OnRemoteConnected func(e *ConnectedEvent) `json:"-"` OnNewClientConnection func(event *ClientConnectionEvent) `json:"-"` OnClientConnectionClose func(event *ClientConnectCloseEvent) `json:"-"` GuiLog io.Writer `json:"-"` }
func DefaultSuo5Config ¶
func DefaultSuo5Config() *Suo5Config
func (*Suo5Config) HeaderString ¶ added in v1.3.0
func (s *Suo5Config) HeaderString() string
func (*Suo5Config) Parse ¶ added in v1.3.0
func (s *Suo5Config) Parse() error
type SwitchableCookieJar ¶ added in v1.3.1
func (*SwitchableCookieJar) Cookies ¶ added in v1.3.1
func (f *SwitchableCookieJar) Cookies(u *url.URL) []*http.Cookie
func (*SwitchableCookieJar) SetCookies ¶ added in v1.3.1
func (f *SwitchableCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)
Click to show internal directories.
Click to hide internal directories.