Documentation ¶
Index ¶
- Variables
- func DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (net.Conn, *http.Response, error)
- func LoadPeriod(ctx context.Context, buf []byte, configF File, configS *[]Config, ...) error
- func Matched(matchHeader []Header, r *http.Request) bool
- func MatchedOne(matchHeader Header, value string) bool
- func Test(ctx context.Context, port int, logger Logger)
- func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (net.Conn, error)
- type Back
- type Config
- type File
- type HandshakeError
- type Header
- type Logger
- type Route
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRedirect = errors.New("ErrRedirect") ErrNoHttp = errors.New("ErrNoHttp") ErrNoWs = errors.New("ErrNoWs") ErrCopy = errors.New("ErrCopy") ErrReqCreFail = errors.New("ErrReqCreFail") ErrReqDoFail = errors.New("ErrReqDoFail") ErrResDoFail = errors.New("ErrResDoFail") ErrHeaderCheckFail = errors.New("ErrHeaderCheckFail") )
Functions ¶
func DialContext ¶ added in v0.1.20231214143418
func LoadPeriod ¶
func LoadPeriod(ctx context.Context, buf []byte, configF File, configS *[]Config, logger Logger) error
加载
func MatchedOne ¶ added in v0.1.20240305005058
Types ¶
type Back ¶
type Back struct { Name string `json:"name"` To string `json:"to"` Weight int `json:"weight"` ErrBanSec int `json:"errBanSec"` Splicing int `json:"-"` PathAdd bool `json:"-"` MatchHeader []Header `json:"matchHeader"` ReqHeader []Header `json:"reqHeader"` ResHeader []Header `json:"resHeader"` // contains filtered or unexported fields }
type Config ¶
type Config struct { Addr string `json:"addr"` TLS struct { Pub string `json:"pub"` Key string `json:"key"` } `json:"tls"` MatchRule string `json:"matchRule"` CopyBlocks int `json:"copyBlocks"` BlocksI pslice.BlocksI[byte] `json:"-"` Routes []Route `json:"routes"` // contains filtered or unexported fields }
type HandshakeError ¶ added in v0.1.20231214143418
type HandshakeError struct {
// contains filtered or unexported fields
}
func (HandshakeError) Error ¶ added in v0.1.20231214143418
func (t HandshakeError) Error() string
type Route ¶
type Route struct { Path string `json:"path"` Splicing int `json:"splicing"` PathAdd bool `json:"pathAdd"` MatchHeader []Header `json:"matchHeader"` ReqHeader []Header `json:"reqHeader"` ResHeader []Header `json:"resHeader"` Backs []Back `json:"backs"` // contains filtered or unexported fields }
func (*Route) FiliterBackByRequest ¶ added in v0.1.20240305005058
Click to show internal directories.
Click to hide internal directories.