mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-23 06:42:51 +00:00
24 lines
379 B
Go
24 lines
379 B
Go
package net
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
func Listen(network, address string) (Listener, error) {
|
|
l, err := net.Listen(network, address)
|
|
if err != nil {
|
|
return Listener{}, err
|
|
}
|
|
|
|
return Listener{listener: l}, nil
|
|
}
|
|
|
|
func Dial(network, address string) (Conn, error) {
|
|
conn, err := net.Dial(network, address)
|
|
if err != nil {
|
|
return Conn{}, err
|
|
}
|
|
|
|
return Conn{conn: conn}, nil
|
|
}
|