add tun/tap

This commit is contained in:
ginuerzh
2021-12-20 22:00:08 +08:00
parent a853d99d92
commit e21c35a47f
73 changed files with 1866 additions and 613 deletions
+1 -5
View File
@@ -76,7 +76,7 @@ func (h *ssHandler) Handle(ctx context.Context, conn net.Conn) {
addr := &gosocks5.Addr{}
if _, err := addr.ReadFrom(conn); err != nil {
h.logger.Error(err)
h.discard(conn)
io.Copy(ioutil.Discard, conn)
return
}
@@ -110,7 +110,3 @@ func (h *ssHandler) Handle(ctx context.Context, conn net.Conn) {
}).
Infof("%s >-< %s", conn.RemoteAddr(), addr)
}
func (h *ssHandler) discard(conn net.Conn) {
io.Copy(ioutil.Discard, conn)
}