Improve: Dial would reset proxy alive status

This commit is contained in:
Dreamacro
2019-03-16 00:43:16 +08:00
parent 8c608f5d7a
commit acf55a7f64
9 changed files with 103 additions and 122 deletions

View File

@ -23,13 +23,20 @@ type ServerAdapter interface {
Close()
}
type Proxy interface {
type ProxyAdapter interface {
Name() string
Type() AdapterType
Dial(metadata *Metadata) (net.Conn, error)
Destroy()
MarshalJSON() ([]byte, error)
}
type Proxy interface {
ProxyAdapter
Alive() bool
URLTest(url string) (int16, error)
}
// AdapterType is enum of adapter type
type AdapterType int