SpoofDPI/packet/https.go

24 lines
348 B
Go
Raw Normal View History

2022-01-08 15:35:32 +09:00
package packet
2022-01-08 03:01:54 +09:00
2022-01-09 00:09:01 +09:00
type HttpsPacket struct {
2022-01-12 02:15:45 +09:00
raw []byte
2022-01-08 03:01:54 +09:00
}
2022-01-11 04:27:12 +09:00
func NewHttpsPacket(raw []byte) HttpsPacket {
2022-01-09 00:09:01 +09:00
return HttpsPacket{
2022-01-12 02:15:45 +09:00
raw: raw,
2022-01-08 03:01:54 +09:00
}
}
2022-01-12 02:15:45 +09:00
func (p *HttpsPacket) Raw() []byte {
return p.raw
}
func (p *HttpsPacket) SplitInChunks() [][]byte {
if len(p.Raw()) < 1 {
return [][]byte{p.Raw()}
2022-01-08 03:01:54 +09:00
}
2022-01-12 02:15:45 +09:00
return [][]byte{(p.Raw())[:1], (p.Raw())[1:]}
2022-01-08 03:01:54 +09:00
}