SpoofDPI/packet/https.go

20 lines
291 B
Go
Raw Normal View History

2022-01-08 06:35:32 +00:00
package packet
2022-01-07 18:01:54 +00:00
2022-01-08 15:09:01 +00:00
type HttpsPacket struct {
2022-01-07 18:01:54 +00:00
Raw *[]byte
}
2022-01-08 15:09:01 +00:00
func NewHttpsPacket(raw *[]byte) HttpsPacket {
return HttpsPacket{
2022-01-07 18:01:54 +00:00
Raw: raw,
}
}
2022-01-08 15:09:01 +00:00
func (r HttpsPacket) SplitInChunks() [][]byte {
2022-01-07 18:01:54 +00:00
if len(*r.Raw) < 1 {
return [][]byte{*r.Raw}
}
return [][]byte{(*r.Raw)[:1], (*r.Raw)[1:]}
}