mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 10:01:28 +00:00
SplitHTTP: ok -> ooooooooook (parser in client)
https://github.com/XTLS/Xray-core/pull/3479#issuecomment-2196370334
This commit is contained in:
parent
c0f3bf66fd
commit
8320732743
|
@ -213,8 +213,9 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip "ok" response
|
// skip "ooooooooook" response
|
||||||
trashHeader := []byte{0, 0}
|
trashHeader := []byte{0}
|
||||||
|
for {
|
||||||
_, err = io.ReadFull(response.Body, trashHeader)
|
_, err = io.ReadFull(response.Body, trashHeader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.Body.Close()
|
response.Body.Close()
|
||||||
|
@ -222,6 +223,10 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||||
gotDownResponse.Close()
|
gotDownResponse.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if trashHeader[0] == 'k' {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
downResponse = response.Body
|
downResponse = response.Body
|
||||||
gotDownResponse.Close()
|
gotDownResponse.Close()
|
||||||
|
|
Loading…
Reference in a new issue