webssh icon indicating copy to clipboard operation
webssh copied to clipboard

add delay to .send

Open CarlFK opened this issue 1 year ago • 1 comments

https://github.com/huashengdun/webssh/blob/master/webssh/static/js/main.js#L447 wssh.send = function(data) {

I would like a delay between characters so it looks like someone typing.

So add an optional parameter of delay (in ms because setTimeout wants ms)

function(data,delay=0)
for each c in data 
  sock.send(c);
  something something setTimeout(resolve, delay))

I found this here: https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep

CarlFK avatar Sep 11 '24 18:09 CarlFK

This seems like something that that should be coded by someone who knows what they are doing. Which is not me.

I will try to find someone to do this if I get some encouragement, like t seems like something that would be merged if done well.

CarlFK avatar Sep 11 '24 18:09 CarlFK