2019-09-18 19:40:14 +08:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
import "net"
|
|
|
|
|
|
|
|
// Proxy is a dialer manager
|
|
|
|
type Proxy interface {
|
|
|
|
// Dial connects to the given address via the proxy.
|
2020-04-28 15:18:19 +08:00
|
|
|
Dial(network, addr string) (c net.Conn, dialer Dialer, err error)
|
2019-09-18 19:40:14 +08:00
|
|
|
|
|
|
|
// DialUDP connects to the given address via the proxy.
|
|
|
|
DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error)
|
|
|
|
|
2020-04-29 18:45:58 +08:00
|
|
|
// Get the dialer by dstAddr.
|
2019-09-18 19:40:14 +08:00
|
|
|
NextDialer(dstAddr string) Dialer
|
2020-04-28 15:18:19 +08:00
|
|
|
|
|
|
|
// Record records result while using the dialer from proxy.
|
|
|
|
Record(dialer Dialer, success bool)
|
2019-09-18 19:40:14 +08:00
|
|
|
}
|