Giter Club home page Giter Club logo

Comments (5)

AviiNL avatar AviiNL commented on July 23, 2024 2

Hah. how did I not think of that.
Yes, implementing drop does trigger when the client disconnects.

Thanks a bunch! :D

from russh.

Eugeny avatar Eugeny commented on July 23, 2024

You're experiencing the difference between having a TTY and not. When a TTY is allocated, the SSH client will send the keystrokes immediately and supply additional information such as terminal size.

With OpenSSH, ssh <host> defaults to having a allocating PTY when the client itself running in a terminal, and ssh <host> <command> defaults to working without one. You can override both:

  • ssh -T <host> - shell without a TTY
  • ssh -t <host> <command> - exec with a TTY

from russh.

Eugeny avatar Eugeny commented on July 23, 2024

P.S. ctrl-c will send a signal instead when no PTY is allocated

from russh.

AviiNL avatar AviiNL commented on July 23, 2024

Thanks for the quick response! :)

I am logging signals using

fn signal(self, channel: ChannelId, signal_name: russh::Sig, session: Session) -> Self::FutureUnit {
    info!("Signal: {} {:?}", channel, signal_name);
    self.finished(session)
}

but nothing is coming in, the ssh client just drops back to shell..

Unfortunately because of current (already running) client implementations I can't add a -t to the client requests.

I'm working on re-writing my personal proxy server from typescript to rust, so I can't change how to the clients interacts with the server.

I would at the very least expect a channel_close when a client disconnects, since a channel is opened via channel_open_session, Or am I misunderstanding how this should work?

from russh.

Eugeny avatar Eugeny commented on July 23, 2024

It's possible that your client just kills the connection without sending a signal or a channel_close message - in this case you can implement Drop for your handler - russh will drop it when the connection ends.

from russh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.