SpoofDPI/net/listener.go

19 lines
243 B
Go
Raw Normal View History

package net
import (
"net"
)
type Listener struct {
2022-05-13 09:49:05 +00:00
listener *net.TCPListener
}
2022-05-13 09:49:05 +00:00
func (l *Listener) Accept() (*Conn, error) {
conn, err := l.listener.AcceptTCP()
if err != nil {
2022-05-13 09:49:05 +00:00
return &Conn{}, err
}
2022-05-13 09:49:05 +00:00
return &Conn{conn: conn}, nil
}