chore: gofmt files left unformatted
CI / validate (push) Successful in 34s
CI / images (deploy/Dockerfile.api, api) (push) Successful in 1m1s
CI / images (deploy/Dockerfile.checker, checker) (push) Successful in 47s
CI / images (deploy/Dockerfile.web, web) (push) Successful in 27s

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:
omar
2026-08-08 17:48:55 +03:00
co-authored by Claude Opus 5
parent 5785be4964
commit ec781fec19
5 changed files with 22 additions and 22 deletions
+2 -2
View File
@@ -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()
+1 -1
View File
@@ -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])
+1 -1
View File
@@ -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
View File
@@ -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) {
+3 -3
View File
@@ -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
}