mirror of
https://github.com/cnlh/nps.git
synced 2024-04-21 12:31:54 +00:00
add new file
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user