-
Notifications
You must be signed in to change notification settings - Fork 0
Event Handles
dharm pimsen edited this page Mar 17, 2024
·
4 revisions
To handle the event can use on_user() decorator
ssh = Server()
@ssh.on_user("...")
def ...(...output...):
...
return ..return..channel is socket
client is client manager
Called when user connected to server and authenticated
output channel, client
return True/False
Called when user press enter to server and authenticating
output channel, data, client
{
"username": ...,
"password": ...,
}Called when user connected to server and authenticated
output channel, data, client
{
"term": ...,
"width": ...,
"height": ...,
"pixelwidth": ...,
"pixelheight": ...,
"modes": ...
}Called when user resized terminal
output channel, data, client
{
"width": ...,
"height": ...,
"pixelwidth": ...,
"pixelheight": ...
}Called when user entered command
output channel, command, client
Called when inside command event error
output channel, error, client
Called when inside command event error
output peername, client