mihomo/constant/listener.go

30 lines
506 B
Go
Raw Normal View History

2021-08-01 00:35:37 +08:00
package constant
import "net"
2021-08-01 00:35:37 +08:00
type Listener interface {
RawAddress() string
Address() string
Close() error
}
type AdvanceListener interface {
Close()
Config() string
HandleConn(conn net.Conn, in chan<- ConnContext)
}
2022-12-04 13:37:14 +08:00
2022-12-04 21:53:13 +08:00
type InboundListener interface {
2022-12-04 13:37:14 +08:00
Name() string
2022-12-04 15:15:23 +08:00
Listen(tcpIn chan<- ConnContext, udpIn chan<- PacketAdapter) error
2022-12-04 13:37:14 +08:00
Close() error
Address() string
RawAddress() string
2022-12-04 21:53:13 +08:00
Config() InboundConfig
}
type InboundConfig interface {
Name() string
Equal(config InboundConfig) bool
2022-12-04 13:37:14 +08:00
}