gotunnelserver/server/handleAgent.go

16 lines
312 B
Go
Raw Normal View History

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)
}