ssh execute command error: can't connect str to butes
ssh 發送下一次指令回傳的是上一次指令的結果
ssh 始終停留在 root 目錄內
ssh 能正確回傳了但回傳值有附加的字符<-[0m <-[01;34m**
websocket 沒有錯誤斷開但只發送不回傳
更新了代碼刷新頁面之后websocket close
此文章后續還會繼續補充,未完待續。。。
ssh execute command error: can't connect str to butes
channel.send(msg + b'\n')
out = channel.recv(1024)
錯誤code
channel.send(msg + b'\n')
out = channel.recv(1024)
uwsgi.websocket_send(out)
解決code
channel.send(msg + b'\n')
time.sleep(0.3) # 等待一段時間
out = channel.recv(1024)
ssh 始終停留在 root 目錄內
錯誤code
channel.send(msg + b'\n')
out = channel.recv(1024)
uwsgi.websocket_send(out)
解決code
channel.send(msg + b'\n')
time.sleep(0.3) # 等待一段時間
out = channel.recv(1024)
ssh 能正確回傳了但回傳值有附加的字符<-[0m <-[01;34m
現象:
[root@localhost ~]#ls
anaconda-ks,cfg <-[0m<-[01;34mdino<-[0m <-[01;34mgrub<-[0m
<-[01;34mDecktop<-[0m <-[01;34mDocuments<-[0m
解決:
這是 linux 環境下自帶的字符串顏色識別字符
用前端插件 term.js 識別顏色字符
console:
sending.....
更新了代碼刷新頁面之后 websocket close
console:
connect! websocket open
Connection is closed...
解決:
更新代碼之后要reload, 這時 websocket 會被關掉 刷新時是還沒處於正在關閉狀態 再刷一次就好了