Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
191bb109
Commit
191bb109
authored
May 22, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug that client closes websocket on handling non utf-8 encoded bytes
parent
28360c31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
main.js
webssh/static/js/main.js
+8
-2
worker.py
webssh/worker.py
+1
-1
No files found.
webssh/static/js/main.js
View file @
191bb109
...
@@ -91,8 +91,14 @@ jQuery(function($){
...
@@ -91,8 +91,14 @@ jQuery(function($){
};
};
socket
.
onmessage
=
function
(
msg
)
{
socket
.
onmessage
=
function
(
msg
)
{
// console.log(msg);
var
reader
=
new
FileReader
();
term
.
write
(
msg
.
data
);
reader
.
onloadend
=
function
(
event
){
var
decoder
=
new
TextDecoder
();
var
text
=
decoder
.
decode
(
reader
.
result
);
// console.log(text);
term
.
write
(
text
);
};
reader
.
readAsArrayBuffer
(
msg
.
data
);
};
};
socket
.
onerror
=
function
(
e
)
{
socket
.
onerror
=
function
(
e
)
{
...
...
webssh/worker.py
View file @
191bb109
...
@@ -63,7 +63,7 @@ class Worker(object):
...
@@ -63,7 +63,7 @@ class Worker(object):
logging
.
debug
(
'{!r} to {}:{}'
.
format
(
data
,
*
self
.
handler
.
src_addr
))
logging
.
debug
(
'{!r} to {}:{}'
.
format
(
data
,
*
self
.
handler
.
src_addr
))
try
:
try
:
self
.
handler
.
write_message
(
data
)
self
.
handler
.
write_message
(
data
,
binary
=
True
)
except
tornado
.
websocket
.
WebSocketClosedError
:
except
tornado
.
websocket
.
WebSocketClosedError
:
self
.
close
(
reason
=
'websocket closed'
)
self
.
close
(
reason
=
'websocket closed'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment