GithubHelp home page GithubHelp logo

Comments (9)

toewsar avatar toewsar commented on May 27, 2024 2

First tests were successful. Thank you.

from cumulocity-remote-access-local-proxy.

reubenmiller avatar reubenmiller commented on May 27, 2024

@toewsar do you happen to have an easy way to reproduce it? Iā€™d say the fix will be relatively easy (as some kind of shutdown signal is probably missing), but just finding the right spot might be more difficult.

from cumulocity-remote-access-local-proxy.

toewsar avatar toewsar commented on May 27, 2024

@reubenmiller it should possible to reproduce, by restarting the remote-access app in the device while a connection is running.

  1. Start the proxy in server mode
host$ c8ylp server ABCD --env-file .env -c ssh --port 22222
  1. Open a ssh connection
host$ ssh admin@localhost -p 22222
  1. Disconnect the device from websocket (e.g. by pulling the cable)
  2. You shoud see in the c8ylp output [c8ylp] INFO WebSocket Connection closed. Status: 1000 (NORMAL)
  3. The local ssh is still open, but shoudn't

from cumulocity-remote-access-local-proxy.

switschel avatar switschel commented on May 27, 2024

@reubenmiller I had this implemented in the previous version of c8ylp.

if self.tcp_server.is_tcp_socket_available():

I think we can do something similar here:

def _on_ws_close(self, _ws, close_status, close_reason):

We can use the proxy and call shutdown()? Anything that I'm missing?

from cumulocity-remote-access-local-proxy.

switschel avatar switschel commented on May 27, 2024

It's also a question of expected behavior in server mode. In last version I expected that it runs forever, so on each disconnect of WS it tries to reconnect instead of terminating the whole proxy instance.

from cumulocity-remote-access-local-proxy.

toewsar avatar toewsar commented on May 27, 2024

Every protocol that requires a specific handshake at the beginning and does not send keepalive frames won't work if the client doesn't get informed about the connection abort.

from cumulocity-remote-access-local-proxy.

switschel avatar switschel commented on May 27, 2024

For that reason we have to discuss what's the best scenario on web socket disconnect is:

  1. Disconnecting the TCP client and shutting down the whole c8ylp instance - tcp-server is shutdown
  2. Disconnecting the TCP client and keep the c8ylp alive - tcp-server is accepting new connections

I would prefer the 2. option but only in server mode, so we cannot just run "shutdown" (option 1) but have to implement a new function "disconnect" which disconnects the client but keeps the server alive.

from cumulocity-remote-access-local-proxy.

toewsar avatar toewsar commented on May 27, 2024

I would also prefer the 2. option.

from cumulocity-remote-access-local-proxy.

reubenmiller avatar reubenmiller commented on May 27, 2024

@toewsar This should be fixed now in v2.4.1. Please let use know if this is not the case.

from cumulocity-remote-access-local-proxy.

Related Issues (7)

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.