chore: gofmt files left unformatted
Trailing whitespace and comment/field alignment only; no behaviour change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -72,9 +72,9 @@ func (d *Dialer) Dial(ctx context.Context, up *upstream.Upstream, dest string) (
|
||||
h := sha256.New224()
|
||||
h.Write([]byte(up.Trojan.Password))
|
||||
pwHash := hex.EncodeToString(h.Sum(nil))
|
||||
|
||||
|
||||
headerPrefix := fmt.Sprintf("%s\r\n\x01", pwHash)
|
||||
|
||||
|
||||
addrBuf, err := upstream.EncodeAddress(dest)
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
|
||||
@@ -56,7 +56,7 @@ func createAuthID(cmdKey []byte, t int64) [16]byte {
|
||||
rand.Read(random)
|
||||
buf.Write(random) // 4 bytes → buf = 12 bytes
|
||||
|
||||
zero := crc32.ChecksumIEEE(buf.Bytes()) // CRC32 of 12-byte prefix
|
||||
zero := crc32.ChecksumIEEE(buf.Bytes()) // CRC32 of 12-byte prefix
|
||||
binary.Write(buf, binary.BigEndian, zero) // 4 bytes → buf = 16 bytes
|
||||
|
||||
aesBlock, _ := aes.NewCipher(kdf(cmdKey[:], kdfSaltConstAuthIDEncryptionKey)[:16])
|
||||
|
||||
@@ -95,7 +95,7 @@ func TestCanonicalize_KeepsDistinct(t *testing.T) {
|
||||
"vless://u@h.com:443?security=reality&pbk=KEY2&sid=ab&sni=x.com", // different pbk
|
||||
"vless://u@h.com:443?security=reality&pbk=KEY1&sid=ab&sni=y.com", // different sni
|
||||
"vless://u@h.com:443?type=ws&security=tls&sni=x.com&path=%2Fa",
|
||||
"vless://u@h.com:443?type=ws&security=tls&sni=x.com&path=%2Fb", // different path
|
||||
"vless://u@h.com:443?type=ws&security=tls&sni=x.com&path=%2Fb", // different path
|
||||
"vless://u2@h.com:443?type=ws&security=tls&sni=x.com&path=%2Fa", // different uuid
|
||||
"vless://u@h.com:8443?type=ws&security=tls&sni=x.com&path=%2Fa", // different port
|
||||
}
|
||||
|
||||
+15
-15
@@ -203,21 +203,21 @@ func splitHostPort(s string) (string, int, error) {
|
||||
}
|
||||
|
||||
type vmessJSON struct {
|
||||
V interface{} `json:"v"`
|
||||
Ps string `json:"ps"`
|
||||
Add string `json:"add"`
|
||||
Port interface{} `json:"port"`
|
||||
ID string `json:"id"`
|
||||
Aid interface{} `json:"aid"`
|
||||
Scy string `json:"scy"`
|
||||
Net string `json:"net"`
|
||||
Type string `json:"type"`
|
||||
Host string `json:"host"`
|
||||
Path string `json:"path"`
|
||||
TLS string `json:"tls"`
|
||||
SNI string `json:"sni"`
|
||||
Alpn string `json:"alpn"`
|
||||
Fp string `json:"fp"`
|
||||
V interface{} `json:"v"`
|
||||
Ps string `json:"ps"`
|
||||
Add string `json:"add"`
|
||||
Port interface{} `json:"port"`
|
||||
ID string `json:"id"`
|
||||
Aid interface{} `json:"aid"`
|
||||
Scy string `json:"scy"`
|
||||
Net string `json:"net"`
|
||||
Type string `json:"type"`
|
||||
Host string `json:"host"`
|
||||
Path string `json:"path"`
|
||||
TLS string `json:"tls"`
|
||||
SNI string `json:"sni"`
|
||||
Alpn string `json:"alpn"`
|
||||
Fp string `json:"fp"`
|
||||
}
|
||||
|
||||
func parseVMess(raw string) (*Upstream, error) {
|
||||
|
||||
@@ -28,9 +28,9 @@ type Upstream struct {
|
||||
VMess *VMessConfig
|
||||
|
||||
// Transport-specific (common for VLESS/Trojan)
|
||||
Transport string // tcp, ws, grpc, xhttp
|
||||
Path string
|
||||
Header map[string]string
|
||||
Transport string // tcp, ws, grpc, xhttp
|
||||
Path string
|
||||
Header map[string]string
|
||||
ServiceName string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user