chore: listeners support shadowsocks/vmess
This commit is contained in:
@ -36,10 +36,10 @@ func (l *Listener) Close() error {
|
||||
|
||||
func New(addr string, in chan<- C.ConnContext, additions ...inbound.Addition) (*Listener, error) {
|
||||
if len(additions) == 0 {
|
||||
additions = []inbound.Addition{{
|
||||
InName: "DEFAULT-SOCKS",
|
||||
SpecialRules: "",
|
||||
}}
|
||||
additions = []inbound.Addition{
|
||||
inbound.WithInName("DEFAULT-SOCKS"),
|
||||
inbound.WithSpecialRules(""),
|
||||
}
|
||||
}
|
||||
l, err := inbound.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
|
@ -35,10 +35,10 @@ func (l *UDPListener) Close() error {
|
||||
|
||||
func NewUDP(addr string, in chan<- C.PacketAdapter, additions ...inbound.Addition) (*UDPListener, error) {
|
||||
if len(additions) == 0 {
|
||||
additions = []inbound.Addition{{
|
||||
InName: "DEFAULT-SOCKS",
|
||||
SpecialRules: "",
|
||||
}}
|
||||
additions = []inbound.Addition{
|
||||
inbound.WithInName("DEFAULT-SOCKS"),
|
||||
inbound.WithSpecialRules(""),
|
||||
}
|
||||
}
|
||||
l, err := net.ListenPacket("udp", addr)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user