2024-11-13 00:00:06 +08:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gorilla/websocket"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s *Server) HandleAgent(c *websocket.Conn, r *http.Request) {
|
2024-11-13 22:26:29 +08:00
|
|
|
agentSession := NewSession(c)
|
|
|
|
agentSession.Start()
|
|
|
|
s.agentSession[agentSession.Id] = agentSession
|
2024-11-15 16:49:01 +08:00
|
|
|
command := NcmdSession(agentSession.Id)
|
2024-11-13 22:26:29 +08:00
|
|
|
agentSession.Send(command)
|
2024-11-13 00:00:06 +08:00
|
|
|
}
|