Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Keeping the browser terminal session connected

Keeping the browser terminal session connected

Scheduled Pinned Locked Moved Solved Support
webterminal
17 Posts 6 Posters 1.8k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • robiR Offline
    robiR Offline
    robi
    wrote on last edited by joseph
    #1

    Many times there is a need to keep multiple browser terminal sessions open across different apps and systems and the information from one is necessary for the other.

    However it's super frustrating when some timeout happens and reloads the terminal w/o warning. This results in a loss of all the accumulated information in that session and requires a long redo process.

    How do we prevent the websockets from timing out?
    Why isn't there a keepalive?

    Can we improve the reconnect as a keepalive instead?

    Conscious tech

    1 Reply Last reply
    2
    • nebulonN Away
      nebulonN Away
      nebulon
      Staff
      wrote on last edited by
      #2

      I can't find an obvious explicit timeout, maybe the browser suspends the tab or so? How long a timeout are we roughly talking about and does this also happen if you use the cloudron cli tool to open a terminal into the app? Will keep some terminal tabs open to see if I can reproduce this easily, so far I haven't at least noticed it.

      1 Reply Last reply
      0
      • robiR Offline
        robiR Offline
        robi
        wrote on last edited by robi
        #3

        I ran a script to time it and output the date command to a file every second.

        It started and finished with these two entries:

        Wed Dec 25 23:14:07 UTC 2024
        ...
        Wed Dec 25 23:21:12 UTC 2024
        

        The tab did not go to sleep.

        Conscious tech

        1 Reply Last reply
        0
        • nebulonN Away
          nebulonN Away
          nebulon
          Staff
          wrote on last edited by
          #4

          oh, my terminal tabs are still up, just left them there since my last post here. So looks like something else is interfering here then and closing the socket. I have only tested on firefox here though.

          1 Reply Last reply
          0
          • robiR Offline
            robiR Offline
            robi
            wrote on last edited by
            #5

            It's odd, I just tried it in Brave (the previous was in Iron) and it lasted a lot longer:

            Thu Dec 26 00:22:16 UTC 2024
            ...
            Thu Dec 26 00:36:05 UTC 2024
            

            Conscious tech

            1 Reply Last reply
            0
            • KubernetesK Offline
              KubernetesK Offline
              Kubernetes
              App Dev
              wrote on last edited by Kubernetes
              #6

              You should use tmux or gnu screen for that use case 🙂

              https://www.gnu.org/software/screen/manual/screen.html
              https://github.com/tmux/tmux/wiki

              I prefer tmux myself.

              Ah, sorry, you are talking about the browser shells only?

              1 Reply Last reply
              0
              • necrevistonnezrN Offline
                necrevistonnezrN Offline
                necrevistonnezr
                wrote on last edited by
                #7

                Yes, I believe he is and I‘ve noticed the same annoyance a couple of times. I think it depends on your specific browser and how it handles power management.

                robiR 1 Reply Last reply
                0
                • necrevistonnezrN necrevistonnezr

                  Yes, I believe he is and I‘ve noticed the same annoyance a couple of times. I think it depends on your specific browser and how it handles power management.

                  robiR Offline
                  robiR Offline
                  robi
                  wrote on last edited by
                  #8

                  @Kubernetes TY, I made it clearer in the OP.

                  @necrevistonnezr Thanks for the hint. I am trying out the Staying Alive extension to see if it does the trick for the domain or just the terminal sessions.

                  Conscious tech

                  1 Reply Last reply
                  1
                  • robiR Offline
                    robiR Offline
                    robi
                    wrote on last edited by
                    #9

                    No go so far with the extension.

                    Console log shows:

                    Uncaught Error: Could not dispose an addon that has not been loaded
                        at Proxy._wrappedAddonDispose (terminal-BYZevxTX.js:8:31585)
                        at l.dispose (terminal-BYZevxTX.js:8:31403)
                        at WebSocket.<anonymous> (terminal-BYZevxTX.js:9:1319)
                    terminal-BYZevxTX.js:9 Socket closed. Reconnecting...
                    cs.js:65 
                    

                    Conscious tech

                    1 Reply Last reply
                    1
                    • nebulonN Away
                      nebulonN Away
                      nebulon
                      Staff
                      wrote on last edited by
                      #10

                      Do you happen to have anything like Cloudflare proxy in front of your system? Maybe that gets into the way?

                      robiR 1 Reply Last reply
                      0
                      • nebulonN nebulon

                        Do you happen to have anything like Cloudflare proxy in front of your system? Maybe that gets into the way?

                        robiR Offline
                        robiR Offline
                        robi
                        wrote on last edited by
                        #11

                        @nebulon No, CF is DNS only.

                        Conscious tech

                        1 Reply Last reply
                        0
                        • nebulonN Away
                          nebulonN Away
                          nebulon
                          Staff
                          wrote on last edited by
                          #12

                          Then I am out of ideas without further error details, something seems to pause/disconnect the websocket connection.

                          1 Reply Last reply
                          0
                          • robiR Offline
                            robiR Offline
                            robi
                            wrote on last edited by
                            #13

                            Not sure what else to provide other than flip the script and revisit the OP asking what can we do to make the browser keep thinking it's alive? Send NOOPs?

                            Conscious tech

                            1 Reply Last reply
                            0
                            • fbartelsF Offline
                              fbartelsF Offline
                              fbartels
                              App Dev
                              wrote on last edited by
                              #14

                              Do other solutions, like for example guacamole suffer from the same issue?

                              I think i am personally leaning towards using the cloudron cli, as this way I can use tmux for persistence and can even share the session. I had tabs crashing because too much memory was used and a reload will always start a new session.

                              1 Reply Last reply
                              0
                              • J joseph marked this topic as a question on
                              • C Offline
                                C Offline
                                corsacca
                                wrote on last edited by
                                #15

                                Using worpdress managed app, after ~90 seconds of inactivity the terminal resets and shows "Reconnecting..." and then the first line.
                                I can be trying to write a mysql query and loose all progress.
                                I'd love a solution to keep the session live.

                                1 Reply Last reply
                                0
                                • nebulonN Away
                                  nebulonN Away
                                  nebulon
                                  Staff
                                  wrote on last edited by
                                  #16

                                  @corsacca since we have no timeouts on our side, do you have any proxying services or something in front of your Cloudron, which may terminate the connection on inactivity?

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    corsacca
                                    wrote on last edited by
                                    #17

                                    Sorry, i should have checked that first.
                                    Downgrading CF proxy to DNS only does seem to fix the issue for me.
                                    Thanks @nebulon.

                                    1 Reply Last reply
                                    0
                                    • J joseph has marked this topic as solved on
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Bookmarks
                                    • Search