WebFaction
Community site: login faq

I have node.js successfully installed and I have 3 custom listening ports which I have properly configured web access to via the websites tool.

I have installed node-inspector via the npm tool as a "global" node.js install (ie it is available for use on the command line). node-inspector (https://github.com/dannycoates/node-inspector) is tool which allows you to debug node.js using the WebKit Developer Tools graphical interface from a remote browser.

The defaults are that node.js 's V8 engine listens for debugging commands on port 5858, node-inspector listens for http connections on port 8080 and the node.js application your are attempting to debug listens for http connection on whatever port you tell it. node-inspector runs as a background process that becomes a child process of the node.js process it attaches to.

If I have the following example ports available and configured as these website addresses:
33101 - mysite.com/node_app (~/webapps/node_app)
44202 - dev.mysite.com
I start node.js in the ~/webapps/node_app directory:
]$ node --debug server.js &
>node.js debugger listening on port 5858
>Server started and listening on port 33101
Then I start node-inspector
]$ node-inspector --web-port=44202 &
>Visit http://0.0.0.0:44202/debug?port=5858 to start debugging

I can then visit dev.mysite.com and the node-inspector gui comes up but there is nothing in it and no scripts listed, etc...

I have also tried to attach directly to the node.js debugging port via the Chromium Dev Tools v8 remote debugger tool in Eclipse. (I start node.js differently for that-> node.js --debug=44202 server.js) But, when I try to have the remote debugger attach to dev.mysite.com, it always does an IP lookup and then attempts to attach directly to the machine IP and debug port, which obviously never works.

Is there a way to make this work on WebFaction? Is there a file or process permissions issue or is it just not supported at all due to the way your servers work?

Thanks for any help

asked 31 May '11, 21:14

mpriour
16112
accept rate: 100%

edited 31 May '11, 21:18


Looks like the fact that node-inspector attempts to communicate with clients via WebSockets is the reason it won't work with my current account set up.

You seemed to have answered the web sockets question before

permanent link

answered 31 May '11, 23:27

mpriour
16112
accept rate: 100%

Yes, thats correct I am afraid getting a dedicated IP would be the only solution to the problem.

(31 May '11, 23:32) neeravk

Hi,

I think you would need the debug port opened in our firewall so that you can access it directly.

We can only do that if you have an dedicated IP.

If you need one, you can file a request using the Panel or a support ticket.

It costs $5/month.

Hope that helps!

permanent link

answered 31 May '11, 21:27

neeravk
1.5k3412
accept rate: 41%

the debug 5858 port is internal.

I can actually telnet into it from a separate ssh terminal or from my current one if I started node.js in debug mode as a background process.

This does however raise obvious concerns about other users on the same machine debugging node.js at the same time. However, we could address those in a different question.

So the node-inspector process listening on port 44202 should be able to attach to the v8 debugger on 127.0.0.1:5858 which it is local to. Unless those are actually running on different machines or different stacks and can't talk across to each other.

(31 May '11, 22:02) mpriour

So, you are saying that the debug port has not been actually assigned to you by the Panel?

If that is he case then if that port gets assigned to any other customer later on you can face problems.

If the inspector does communicate internally then it should not have any problems accessing the port.

(31 May '11, 22:10) neeravk

right the default debug port of 5858 has not been assigned, however, I do have spare listening ports (lets say a 3rd one of 55303) so I could try this again with:
node --debug=55303 server.js &
>node.js debugger listening on port 55303
>Server started and listening on port 33101
node-inspector --web-port=44202

but instead of going to dev.mysite.com/debug?port=5858, I would use:
dev.mysite.com/debug?port=55303
I'll try that right now and let you know how it goes

(31 May '11, 22:37) mpriour

The same problem persist, even when I use my spare assigned port.

http://1337maps.com/1map is node.js listening on internal port 59868 and debugger listening on internal port 11300

http://dev.1337maps.com/debug?port=11300 is node-inspector listening on internal port 22967

(31 May '11, 22:53) mpriour

Are you sure that node-inspector connects to the debugger internally and not at dev.1337maps.com:11300?

(31 May '11, 23:01) neeravk

yes node-inspector connects internally However, here's a clue. From the client side (ie on my local desktop Chrome browser) it tries to establish a WebSockets connection to ws://dev.1337maps.com/debug?port=11300

Does WebFaction allow and properly route websocket connections? Or do I need a static IP with specific firewall rules to create a successful websocket connection?

(31 May '11, 23:10) mpriour

v8 debugger can ONLY listen for debug messages on 127.0.0.1. node-inspector takes that into account and essentially acts as a proxy. Listening on it's configured web port for HTTP traffic and using that to interact with a node.js process locally.

(31 May '11, 23:13) mpriour
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×67
×34
×13

question asked: 31 May '11, 21:14

question was seen: 12,548 times

last updated: 31 May '11, 23:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM