Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add delay to .send #391

Open
CarlFK opened this issue Sep 11, 2024 · 1 comment
Open

add delay to .send #391

CarlFK opened this issue Sep 11, 2024 · 1 comment

Comments

@CarlFK
Copy link

CarlFK commented Sep 11, 2024

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
Copy link
Author

CarlFK commented Sep 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant