MCPcopy
hub / github.com/nirui/sshwifty / newSocketCtl

Function newSocketCtl

application/controller/socket.go:94–109  ·  view source on GitHub ↗
(
	commonCfg configuration.Common,
	cfg configuration.Server,
	cmds command.Commands,
)

Source from the content-addressed store, hash-verified

92}
93
94func newSocketCtl(
95 commonCfg configuration.Common,
96 cfg configuration.Server,
97 cmds command.Commands,
98) socket {
99 randomKey := getNewSocketCtlRandomSharedKey()
100
101 return socket{
102 commonCfg: commonCfg,
103 serverCfg: cfg,
104 randomKey: randomKey,
105 authKey: getSocketAuthKey(randomKey, commonCfg.SharedKey)[:32],
106 upgrader: buildWebsocketUpgrader(cfg),
107 commander: command.New(cmds),
108 }
109}
110
111type websocketWriter struct {
112 *websocket.Conn

Callers 1

BuilderFunction · 0.85

Calls 4

NewFunction · 0.92
buildWebsocketUpgraderFunction · 0.85
getSocketAuthKeyFunction · 0.70

Tested by

no test coverage detected