-
Notifications
You must be signed in to change notification settings - Fork 216
2 instances of sshcode (same machine / same remote user) => WebSocket closed #107
Comments
I think the intention would be to only have one instance of code-server running on your remote machine. Not sure why you would have multiple instances of code-server open. As a workaround (which seems like the only way), you could make a user on your remote server for each of your projects. Then, in your
I think this is more or less what you would be looking for here. |
Hi, thanks for the suggestion but it seems a little overkill to create a user by project. I understand that it would be useless to have multiple servers running, but then shouldn't there be a possibility to run multiple clients connected to the same server, only targeting different directories? By the way, this tool is a life saver for me, so thanks for the effort! EDIT: I guess it is not that easy since code-server itself needs a directory to serve files from if I understand well. So my question is: how come it was possible to have multiple servers running when it was installed in /tmp and it is not possible anymore? |
|
I don't know, I do not use code-server directly, I only tried it once before I discovered sshcode which is simpler and runs in a dedicated window. I guess I could start multiple instances of code-server manually but then it is not as convenient as just running sshcode command with a user@host + dirname |
Ok I forked your project and added a condition in downloadScript() to skip this step entirely if sshcode-server is already running, that way no pkill and a new server is launched. The nice thing to have though would be a single server instance able to open many websocket connections, one per working dir for example, but I have no idea how complex this might be to implement |
I added a comment to the commit where you added this because it looks like you should be using: The multiple web socket connections would have to be implemented within code-server to make this work (since sshcode just creates an ssh tunnel for you). Can you still try to run the script from the download parse and see if you can run multiple instances of code-server (you should be able to, but I am just not sure what the complications are. It looks like since you are not killing the instance, that you would not be able to change the directories at all and would have to actually ssh into the instance to kill the code-server instance (sounds annoying). Not sure what your thoughts are here. |
I'm not sure I understand everything that happens, but with my modified version, the previously running instance is not killed, and when I monitor the server processes with htop I can see the creation of a new sshcode-server process (running code-server in the end) every time I run the script from the client |
whatever works for you is good stuff. |
have you tried code-server running twice on your remote machine without sshcode? |
Nope, sorry. Do you plan on doing this multi client/workingdir/socket any time in code-server? Or is it just not the intended use? Maybe I could help (not right now though I'm passing exams until july) |
I don't work on code-server, but you could open an issue there and I am sure that someone would be able to help. |
Oh, alright, I assumed you worked on it, i'll go there then thanks |
I realized that I was totally wrong. The executable is |
This problem exists with the last version of sshcode (v0.7 I think) that lives in a user local dir on the remote machine.
If you launch sshcode twice from the same local machine and user to the same remote machine and user, the second instance will disconnect the first one. There can be only one instance running on the server. It used to work well with multiple instances when sshcode was running from the /tmp dir, I do not know how to fix it, but it is a problem since I often work on multiple projects on the same server and I do not want to open only one instance containing all my projects since it will slow down search operations, etc. Is it a know problem? Is there any workaround or possible fix?
The text was updated successfully, but these errors were encountered: