add ssu connector

This commit is contained in:
ginuerzh
2021-11-09 23:34:19 +08:00
parent 92dc87830f
commit cae199dbd9
29 changed files with 1031 additions and 678 deletions

17
pkg/dialer/udp/conn.go Normal file
View File

@ -0,0 +1,17 @@
package udp
import "net"
type conn struct {
*net.UDPConn
}
func (c *conn) WriteTo(b []byte, addr net.Addr) (int, error) {
return c.UDPConn.Write(b)
}
func (c *conn) ReadFrom(b []byte) (n int, addr net.Addr, err error) {
n, err = c.UDPConn.Read(b)
addr = c.RemoteAddr()
return
}