Skip to content

Commit

Permalink
feat: upload/download file support per tty
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Sep 16, 2021
1 parent d00831a commit a690e3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ func (br *broker) run() {
data := msg.data

if msg.typ == websocket.BinaryMessage {
typ := msgTypeTermData
if data[0] == 1 {
dev.WriteMsg(msgTypeFile, data[1:])
} else {
dev.WriteMsg(msgTypeTermData, append([]byte(msg.sid), data[1:]...))
typ = msgTypeFile
}
dev.WriteMsg(typ, append([]byte(msg.sid), data[1:]...))
} else {
typ := jsoniter.Get(data, "type").ToString()

Expand Down

0 comments on commit a690e3a

Please sign in to comment.