SpoofDPI/packet/https.go

24 lines
348 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-11 17:15:45 +00:00
raw []byte
2022-01-07 18:01:54 +00:00
}
2022-01-10 19:27:12 +00:00
func NewHttpsPacket(raw []byte) HttpsPacket {
2022-01-08 15:09:01 +00:00
return HttpsPacket{
2022-01-11 17:15:45 +00:00
raw: raw,
2022-01-07 18:01:54 +00:00
}
}
2022-01-11 17:15:45 +00: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-07 18:01:54 +00:00
}
2022-01-11 17:15:45 +00:00
return [][]byte{(p.Raw())[:1], (p.Raw())[1:]}
2022-01-07 18:01:54 +00:00
}