add new file

This commit is contained in:
he liu
2022-01-23 17:30:38 +08:00
parent 05b2e55f39
commit c482967f8c
125 changed files with 9688 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package handler
import (
"ehang.io/nps/lib/enet"
)
const (
recordTypeHandshake uint8 = 22
typeClientHello uint8 = 1
)
type HttpsHandler struct {
DefaultHandler
}
func NewHttpsHandler() *HttpsHandler {
return &HttpsHandler{}
}
func (h *HttpsHandler) GetName() string {
return "https"
}
func (h *HttpsHandler) GetZhName() string {
return "https协议"
}
func (h *HttpsHandler) HandleConn(b []byte, c enet.Conn) (bool, error) {
if b[0] == recordTypeHandshake{
return h.processConn(c)
}
return false, nil
}