I've been practicing with "hello world" examples of websockets and node.js server.
According to all those examples you create a html
file (client) and a js
file (server).
Before you run them, you have to run this on the command line (I use windows)
node nameOFtheServer.js
So, my question. If I close the command line window and open it again the client does not connect to the server. I have to run again the above code in the command line , manually, so the server will start again. Why is this happening? Is that normal? How can I fix it , so I dont have to run the same commands over and over again on the command line in order to start the js
file (server) ?
Thanks
EDIT
OK, new facts, I just edited the question, highlighting the changes in Italics
helloserver.js
has the code from this link andhelloclient.html
has the code from this link .The only difference is that I change the port to listen to 1337. Hmm...maybe is somethong about the port? I have to "activate" it? – slevin Jul 13 '13 at 19:14js
file by simply typingnode helloserver.js
. Sorry, i did not get you... – slevin Jul 13 '13 at 19:22