1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-07-13 12:40:12 -04:00

migrate to std lib

This commit is contained in:
Darien Raymond
2018-11-02 15:47:58 +01:00
parent ee489c95b3
commit 815c7f09ba
18 changed files with 72 additions and 180 deletions

View File

@@ -1,11 +1,11 @@
package tls
import (
"encoding/binary"
"errors"
"strings"
"v2ray.com/core/common"
"v2ray.com/core/common/serial"
)
type SniffHeader struct {
@@ -133,7 +133,7 @@ func SniffTLS(b []byte) (*SniffHeader, error) {
if !IsValidTLSVersion(b[1], b[2]) {
return nil, errNotTLS
}
headerLen := int(serial.BytesToUint16(b[3:5]))
headerLen := int(binary.BigEndian.Uint16(b[3:5]))
if 5+headerLen > len(b) {
return nil, common.ErrNoClue
}