Bug 400450

Summary: We should allow user to assign a port to node inspector when starting server.
Product: [ECD] Orion (Archived) Reporter: libing wang <libingw>
Component: NodeAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: mamacdon
Version: 1.0Keywords: noteworthy
Target Milestone: 4.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2013-02-11 09:29:22 EST
I found this issue when testing the debug URL link and NPM stuff in McQ's raspberry pi.
We are running node inspector on port number 8900 when user first time uses node debug command.
But in McQ's case, port 8900 is not opened.
We should allow user to assign a port number to node inspector at the server start point, which is defaulted to 8900.
Comment 1 Mark Macdonald CLA 2013-02-11 11:02:10 EST
The port number here is only used to host the node-inspector web app. In other words, it's this part of the Debug URL you see when you debug a node script:

http://mynodeserver:8900/debug?port=5860
                    ^^^^

Given that this is just a webapp, it would be way less confusing if it was hosted as part of the Orion server, on the same port we normally use (8081, by default).

We need to investigate if node-inspector supports this. Then a user only has to worry about exposing 1 port through their firewall.
Comment 2 libing wang CLA 2013-07-10 16:00:43 EDT
(In reply to comment #1)
> The port number here is only used to host the node-inspector web app. In
> other words, it's this part of the Debug URL you see when you debug a node
> script:
> 
> http://mynodeserver:8900/debug?port=5860
>                     ^^^^
> 
> Given that this is just a webapp, it would be way less confusing if it was
> hosted as part of the Orion server, on the same port we normally use (8081,
> by default).
> 
> We need to investigate if node-inspector supports this. Then a user only has
> to worry about exposing 1 port through their firewall.

Unfortunately node-inspector does not support the same port used by orionode.

debugger listening on port 5858
Using workspace: d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\.workspace
Listening on port 8081...
   warn  - error raised: Error: listen EADDRINUSE

d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\index.js:31
        throw err;
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:878:11)
    at Server._listen2 (net.js:1016:14)
    at listen (net.js:1038:10)
    at Server.listen (net.js:1104:5)
    at Function.app.listen (d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\node_modules\connect\lib\proto.js:229:24)
    at startServer (d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\index.js:84:5)
    at d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\server.js:50:4
    at Object.exports.readPasswordFile (d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\lib\args.js:76:3)
    at d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\server.js:39:11
    at next (d:\JazzIntegration\OrionSource\org.eclipse.orion.client\modules\orionode\lib\args.js:56:4)