vless: spport server mode

This commit is contained in:
nadoo committed 2020-10-03 20:51:27 +08:00
1 parent 1ed7fbff65
commit 8b6739f12c
15 files changed
+328 -97

No files matched your search

+2 -2
View File
@@ -11,7 +11,7 @@ import (
"github.com/nadoo/glider/proxy/socks"
)
// PktConn .
// PktConn is a udp Packet.Conn.
type PktConn struct {
net.Conn
@@ -58,7 +58,7 @@ func (pc *PktConn) ReadFrom(b []byte) (int, net.Addr, error) {
// Payload
n, err := io.ReadFull(pc.Conn, b[:length])
if err != nil {
return 0, nil, err
return n, nil, err
}
// TODO: check the addr in return value, it's a fake packetConn so the addr is not valid