优化原生ssh连接代码

This commit is contained in:
dushixiang
2021-02-06 00:25:48 +08:00
committed by dushixiang
parent 248815538d
commit d72ab4e21e
20 changed files with 896 additions and 369 deletions

View File

@ -46,11 +46,11 @@ func TunEndpoint(c echo.Context) error {
if len(connectionId) > 0 {
session, err = model.FindSessionByConnectionId(connectionId)
if err != nil {
CloseWebSocket(ws, NotFoundSession, "会话不存在")
logrus.Warnf("会话不存在")
return err
}
if session.Status != model.Connected {
CloseWebSocket(ws, NotFoundSession, "会话未在线")
logrus.Warnf("会话未在线")
return errors.New("会话未在线")
}
configuration.ConnectionID = connectionId