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
cb5424a1
Commit
cb5424a1
authored
May 30, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added dummy check_channel_window_change_request for testing
parent
96d9ae5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
sshserver.py
tests/sshserver.py
+5
-0
test_app.py
tests/test_app.py
+11
-2
handler.py
webssh/handler.py
+1
-1
No files found.
tests/sshserver.py
View file @
cb5424a1
...
...
@@ -76,6 +76,11 @@ class Server (paramiko.ServerInterface):
pixelwidth
,
pixelheight
,
modes
):
return
True
def
check_channel_window_change_request
(
self
,
channel
,
width
,
height
,
pixelwidth
,
pixelheight
):
channel
.
send
(
'resized'
)
return
True
def
run_ssh_server
(
port
=
2200
,
running
=
True
):
# now connect
...
...
tests/test_app.py
View file @
cb5424a1
...
...
@@ -137,12 +137,15 @@ class TestApp(AsyncHTTPTestCase):
msg
=
yield
ws
.
read_message
()
self
.
assertIn
(
b
'Welcome!'
,
msg
)
# message will be ignored silently
# message
s below
will be ignored silently
yield
ws
.
write_message
(
'hello'
)
yield
ws
.
write_message
(
'"hello"'
)
yield
ws
.
write_message
(
'[hello]'
)
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[]}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
{}}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
'ab'
}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
'a'
,
'b'
]}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
{
'a'
:
1
,
'b'
:
2
}}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
100
]}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
100
]
*
10
}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
-
1
,
-
1
]}))
...
...
@@ -152,7 +155,13 @@ class TestApp(AsyncHTTPTestCase):
yield
ws
.
write_message
(
json
.
dumps
({
'data'
:
1
}))
yield
ws
.
write_message
(
json
.
dumps
({
'data'
:
2.1
}))
yield
ws
.
write_message
(
json
.
dumps
({
'key-non-existed'
:
'hello'
}))
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
79
,
23
],
'data'
:
'bye'
}))
# end - those just for testing webssh websocket stablity
yield
ws
.
write_message
(
json
.
dumps
({
'resize'
:
[
79
,
23
]}))
msg
=
yield
ws
.
read_message
()
self
.
assertEqual
(
b
'resized'
,
msg
)
yield
ws
.
write_message
(
json
.
dumps
({
'data'
:
'bye'
}))
msg
=
yield
ws
.
read_message
()
self
.
assertEqual
(
b
'bye'
,
msg
)
ws
.
close
()
webssh/handler.py
View file @
cb5424a1
...
...
@@ -216,7 +216,7 @@ class WsockHandler(MixinHandler, tornado.websocket.WebSocketHandler):
return
resize
=
msg
.
get
(
'resize'
)
if
resize
:
if
resize
and
len
(
resize
)
==
2
:
try
:
worker
.
chan
.
resize_pty
(
*
resize
)
except
(
TypeError
,
struct
.
error
,
paramiko
.
SSHException
):
...
...
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