Show a message when connection to terminal has been lost

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-09-08 15:32:20 -03:00
parent f5c337e03d
commit 3db24bf6a6
4 changed files with 53 additions and 14 deletions

View File

@@ -37,6 +37,15 @@ func WS(so socketio.Socket) {
go m.Receive(func(name string, data []byte) {
so.Emit("instance terminal out", name, string(data))
})
go m.Status(func(name, status string) {
so.Emit("instance terminal status", name, status)
})
err = m.Start()
if err != nil {
log.Println(err)
return
}
so.On("session close", func() {
m.Close()