I'm setting up a REPL over a net socket to interface with a running 
application. While I'm connected to the REPL (via telnet), I'd like to see 
the logs (stdout/stderr) piped through, so I can run commands (as methods 
passed to the REPL context) and see their results.

Previously I had this set up as a plain net/telnet server with fixed 
commands, then I realized a REPL made a lot more sense so I'm refactoring 
it. With the old way, I piped stdout to the server with this approach: 
https://gist.github.com/2758563. (It overwrites process.stdout.write with 
an "interceptor" that writes to the socket.) But that's a pretty convoluted 
solution and it seems like pure streams make more sense.

However, I can't get it to work. I've tried every variation on 
process.stdout.pipe(socket) that I can think of and they either shut down 
the telnet connection as soon as it opens, or they do nothing.

What's the right way to do this? I would imagine it's already a "solved 
problem" somewhere.

(Note, this is still on node 0.6.19, but if this is the kind of thing that 
suddenly became possible with 0.8, that's fine too, it's another reason to 
upgrade quickly.)

Thank you!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to