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:
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 |
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. answered 31 May '11, 23:27 mpriour 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! answered 31 May '11, 21:27 neeravk 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:
but instead of going to dev.mysite.com/debug?port=5858, I would use:
(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
|