update README

This commit is contained in:
ginuerzh 2019-01-02 21:54:56 +08:00
parent 82003f4270
commit 0f824edc1b
5 changed files with 18 additions and 9 deletions

View File

@ -6,6 +6,7 @@ gost - GO Simple Tunnel
[![GoDoc](https://godoc.org/github.com/ginuerzh/gost?status.svg)](https://godoc.org/github.com/ginuerzh/gost)
[![Build Status](https://travis-ci.org/ginuerzh/gost.svg?branch=master)](https://travis-ci.org/ginuerzh/gost)
[![Go Report Card](https://goreportcard.com/badge/github.com/ginuerzh/gost)](https://goreportcard.com/report/github.com/ginuerzh/gost)
[![codecov](https://codecov.io/gh/ginuerzh/gost/branch/2.7/graphs/badge.svg)](https://codecov.io/gh/ginuerzh/gost/branch/2.7)
[![GitHub release](https://img.shields.io/github/release/ginuerzh/gost.svg)](https://github.com/ginuerzh/gost/releases/latest)
[![Snap Status](https://build.snapcraft.io/badge/ginuerzh/gost.svg)](https://build.snapcraft.io/user/ginuerzh/gost)
[![Docker Build Status](https://img.shields.io/docker/build/ginuerzh/gost.svg)](https://hub.docker.com/r/ginuerzh/gost/)

View File

@ -6,6 +6,7 @@ gost - GO Simple Tunnel
[![GoDoc](https://godoc.org/github.com/ginuerzh/gost?status.svg)](https://godoc.org/github.com/ginuerzh/gost)
[![Build Status](https://travis-ci.org/ginuerzh/gost.svg?branch=master)](https://travis-ci.org/ginuerzh/gost)
[![Go Report Card](https://goreportcard.com/badge/github.com/ginuerzh/gost)](https://goreportcard.com/report/github.com/ginuerzh/gost)
[![codecov](https://codecov.io/gh/ginuerzh/gost/branch/2.7/graphs/badge.svg)](https://codecov.io/gh/ginuerzh/gost/branch/2.7)
[![GitHub release](https://img.shields.io/github/release/ginuerzh/gost.svg)](https://github.com/ginuerzh/gost/releases/latest)
[![Snap Status](https://build.snapcraft.io/badge/ginuerzh/gost.svg)](https://build.snapcraft.io/user/ginuerzh/gost)
[![Docker Build Status](https://img.shields.io/docker/build/ginuerzh/gost.svg)](https://hub.docker.com/r/ginuerzh/gost/)

View File

@ -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')
}

View File

@ -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()

View File

@ -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()