[nodejs] remote debugging node from windows...

364 views
Skip to first unread message

billywhizz

unread,
May 2, 2010, 10:47:46 PM5/2/10
to nodejs
have finally been able to debug my node apps running on a remote linux
box from my windows desktop using eclipse. i thought i'd post up here
how i got it working in case anyone else is trying to do the same
thing.

1. Follow the instructions here to get eclipse and the v8 debugger up
and running:

http://wiki.github.com/ry/node/using-eclipse-as-node-applications-debugger

You can stop at the point where you have everything installed and are
ready to debug

2. Run your node script on the remote host using the --debug-brk flag
and using node_g (debug version of node), e.g.
node_g --debug-brk test.js

3. Run the debugger proxy code here (this is pretty nasty with no
error handling) to start up a proxy on the remote host:

http://gist.github.com/387683.

This will listen for remote connections on port 7000 and proxy them to
the node process local port 5858. I couldn't get a connection to the
node process from another machine without this proxy sitting in
between the process being debugged and the outside world. I tried
running the node process with --remote-debugging flag, but it didn't
seem to make any difference.

4. On your workstation/eclipse machine, download this really simple
tcp proxy: http://aluigi.altervista.org/mytoolz/stcppipe.zip and run
it as follows:

stcppipe.exe [REMOTE_MACHINE_NAME] 7000 5858

This will proxy local connections to port 5858 (from eclipse IDE) to
remote machine port 7000 (proxy running on remote machine from step 3)

5. Continue with instructions from Step 1 to debug the remote
application. it should connect, synch up and show you the first line
of your node script if all goes well.

Let me know if anything is unclear or you can't get it working...

--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Zoka

unread,
May 3, 2010, 1:32:23 PM5/3/10
to nodejs
Additional proxy script on debug target is needed because V8 debugger
thread explicitly listens only on 127.0.0.1 (probably a security
measure).

Zoka

On May 3, 12:47 pm, billywhizz <apjohn...@gmail.com> wrote:
> have finally been able to debug my node apps running on a remote linux
> box from my windows desktop using eclipse. i thought i'd post up here
> how i got it working in case anyone else is trying to do the same
> thing.
>
> 1. Follow the instructions here to get eclipse and the v8 debugger up
> and running:
>
> http://wiki.github.com/ry/node/using-eclipse-as-node-applications-deb...
>
> You can stop at the point where you have everything installed and are
> ready to debug
>
> 2. Run your node script on the remote host using the --debug-brk flag
> and using node_g (debug version of node), e.g.
> node_g --debug-brk test.js
>
> 3. Run the debugger proxy code here (this is pretty nasty with no
> error handling) to start up a proxy on the remote host:
>
> http://gist.github.com/387683.
>
> This will listen for remote connections on port 7000 and proxy them to
> the node process local port 5858. I couldn't get a connection to the
> node process from another machine without this proxy sitting in
> between the process being debugged and the outside world. I tried
> running the node process with --remote-debugging flag, but it didn't
> seem to make any difference.
>
> 4. On your workstation/eclipse machine, download this really simple
> tcp proxy:http://aluigi.altervista.org/mytoolz/stcppipe.zipand run

billywhizz

unread,
May 3, 2010, 2:30:21 PM5/3/10
to nodejs
yep. that looks like the case. also, any idea if i can configure
eclipse to debug a remote process? i can't find any way of specifying
the host, only the port. That's why i had to use stcppipe on the
windows/eclipse side... seems like overkill to have to run a proxy on
either side...

Zoka

unread,
May 3, 2010, 4:21:10 PM5/3/10
to nodejs

Eclipse plugin for V8 debugging can not specify remote host - this
feature has already been requested but it is not in yet, so remote
debugging does require proxy both on local and remote machine. I
modified http://wiki.github.com/ry/node/using-eclipse-as-node-applications-debugger
, so proxy script is now up to date with latest Node API.
Reply all
Reply to author
Forward
0 new messages