gotunnelserver/server/handleAgent.go

16 lines
312 B
Go

package server
import (
"net/http"
"github.com/gorilla/websocket"
)
func (s *Server) HandleAgent(c *websocket.Conn, r *http.Request) {
agentSession := NewSession(c)
agentSession.Start()
s.agentSession[agentSession.Id] = agentSession
command := NcmdSession(agentSession.Id)
agentSession.Send(command)
}