SpoofDPI/net/dial.go

24 lines
382 B
Go
Raw Normal View History

package net
import (
"net"
)
func Listen(network, address string) (Listener, error) {
l, err := net.Listen(network, address)
if err != nil {
return Listener{}, err
}
2022-01-11 17:15:45 +00:00
return Listener{listener: l}, nil
}
2022-01-13 16:06:14 +00:00
func Dial(network, address string) (*Conn, error) {
conn, err := net.Dial(network, address)
if err != nil {
2022-01-13 16:06:14 +00:00
return &Conn{}, err
}
2022-01-13 16:06:14 +00:00
return &Conn{conn: conn}, nil
}