help
                                
                                 help copied to clipboard
                                
                                    help copied to clipboard
                            
                            
                            
                        How to open terminal/shell session via server request
I can open up bash and type commands from my local terminal into a remote bash process like so:
const net = require('net');
const cp = require('child_process');
const server = net.createServer(s => {
  const bash = cp.spawn('bash');
  s.pipe(bash.stdin, {end:false});
  bash.stdout.pipe(s);
  bash.stderr.pipe(s);
});
server.listen('4004');
but the problem is, I don't get prompts like this:
<hostname>:<basename> <user> $`
I just get blank space which I can type into which is different than a terminal
I am still looking for answers to this, I updated the question with a bounty here: https://stackoverflow.com/questions/56174957/open-up-shell-on-server-via-http-request/56175507
I ran bash with output as console and with output redirecting to a file. In the former case, the bash itself prints the necessary eye-catcher text, but in later, it does not.
So it looks like in our case we won't have it coming from bash.
in either way, can you try forcing interactive flag ? cp.spawn('bash', ['-i']); 
I am not sure whether it will have any other side effect on other parts of its execution though
@ORESoftware - is this resolved?
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.