update README
This commit is contained in:
parent
82003f4270
commit
0f824edc1b
@ -6,6 +6,7 @@ gost - GO Simple Tunnel
|
||||
[](https://godoc.org/github.com/ginuerzh/gost)
|
||||
[](https://travis-ci.org/ginuerzh/gost)
|
||||
[](https://goreportcard.com/report/github.com/ginuerzh/gost)
|
||||
[](https://codecov.io/gh/ginuerzh/gost/branch/2.7)
|
||||
[](https://github.com/ginuerzh/gost/releases/latest)
|
||||
[](https://build.snapcraft.io/user/ginuerzh/gost)
|
||||
[](https://hub.docker.com/r/ginuerzh/gost/)
|
||||
|
@ -6,6 +6,7 @@ gost - GO Simple Tunnel
|
||||
[](https://godoc.org/github.com/ginuerzh/gost)
|
||||
[](https://travis-ci.org/ginuerzh/gost)
|
||||
[](https://goreportcard.com/report/github.com/ginuerzh/gost)
|
||||
[](https://codecov.io/gh/ginuerzh/gost/branch/2.7)
|
||||
[](https://github.com/ginuerzh/gost/releases/latest)
|
||||
[](https://build.snapcraft.io/user/ginuerzh/gost)
|
||||
[](https://hub.docker.com/r/ginuerzh/gost/)
|
||||
|
13
bypass.go
13
bypass.go
@ -147,7 +147,9 @@ func NewBypassPatterns(reversed bool, patterns ...string) *Bypass {
|
||||
matchers = append(matchers, m)
|
||||
}
|
||||
}
|
||||
return NewBypass(reversed, matchers...)
|
||||
bp := NewBypass(reversed)
|
||||
bp.AddMatchers(matchers...)
|
||||
return bp
|
||||
}
|
||||
|
||||
// Contains reports whether the bypass includes addr.
|
||||
@ -307,13 +309,10 @@ func (bp *Bypass) Stopped() bool {
|
||||
}
|
||||
|
||||
func (bp *Bypass) String() string {
|
||||
bp.mux.RLock()
|
||||
defer bp.mux.RUnlock()
|
||||
|
||||
b := &bytes.Buffer{}
|
||||
fmt.Fprintf(b, "reversed: %v\n", bp.reversed)
|
||||
fmt.Fprintf(b, "reload: %v\n", bp.period)
|
||||
for _, m := range bp.matchers {
|
||||
fmt.Fprintf(b, "reversed: %v\n", bp.Reversed())
|
||||
fmt.Fprintf(b, "reload: %v\n", bp.Period())
|
||||
for _, m := range bp.Matchers() {
|
||||
b.WriteString(m.String())
|
||||
b.WriteByte('\n')
|
||||
}
|
||||
|
@ -970,11 +970,15 @@ func TestHTTP2ProxyWithWebProbeResist(t *testing.T) {
|
||||
Transporter: HTTP2Transporter(nil),
|
||||
}
|
||||
|
||||
u, err := url.Parse(httpSrv.URL)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
server := &Server{
|
||||
Listener: ln,
|
||||
Handler: HTTP2Handler(
|
||||
UsersHandlerOption(url.UserPassword("admin", "123456")),
|
||||
ProbeResistHandlerOption("web:"+httpSrv.URL),
|
||||
ProbeResistHandlerOption("web:"+u.Host),
|
||||
),
|
||||
}
|
||||
go server.Run()
|
||||
|
@ -186,11 +186,15 @@ func TestHTTPProxyWithWebProbeResist(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
u, err := url.Parse(httpSrv.URL)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
server := &Server{
|
||||
Listener: ln,
|
||||
Handler: HTTPHandler(
|
||||
UsersHandlerOption(url.UserPassword("admin", "123456")),
|
||||
ProbeResistHandlerOption("web:"+httpSrv.URL),
|
||||
ProbeResistHandlerOption("web:"+u.Host),
|
||||
),
|
||||
}
|
||||
go server.Run()
|
||||
|
Loading…
Reference in New Issue
Block a user