WTF is this

This commit is contained in:
世界
2024-06-24 09:49:15 +08:00
parent bda93d516b
commit 923d3222b0
41 changed files with 421 additions and 507 deletions

View File

@@ -2,6 +2,7 @@ package trojan
import (
"context"
"encoding/binary"
"net"
"github.com/sagernet/sing/common/auth"
@@ -76,7 +77,8 @@ func (s *Service[K]) NewConnection(ctx context.Context, conn net.Conn, metadata
return E.Cause(err, "skip crlf")
}
command, err := rw.ReadByte(conn)
var command byte
err = binary.Read(conn, binary.BigEndian, &command)
if err != nil {
return E.Cause(err, "read command")
}