Skip to content

Commit 14feac7

Browse files
committed
use the exported magic for detecting DTX
1 parent e740378 commit 14feac7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ios/debugproxy/utun/connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func parseConnectionData(outgoing string, incoming string) error {
108108
outErr := decodeHttp2(outgoing.w, outFile, true)
109109
inErr := decodeHttp2(incoming.w, inFile, false)
110110
if err := errors.Join(outErr, inErr); err != nil {
111-
//return err
111+
return err
112112
}
113113
return parseConnectionData(outgoing.p, incoming.p)
114114
})

ios/debugproxy/utun/decoding.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ func detectType(r io.ReadSeeker) contentType {
4141
if string(b) == "PRI " {
4242
return http2
4343
}
44-
i := binary.LittleEndian.Uint32(b)
45-
if i == 0x29b00b92 {
44+
le := binary.LittleEndian.Uint32(b)
45+
be := binary.BigEndian.Uint32(b)
46+
if le == 0x29b00b92 {
4647
return remoteXpc
4748
}
48-
if string(b[:3]) == "y[=" {
49+
if be == dtx.DtxMessageMagic {
4950
return remoteDtx
5051
}
5152

0 commit comments

Comments
 (0)