node.js port vs visual studio 2013 iis express port - conflict

Trying to learn node.js.

If I create a listening socket on the same port as the port used by the VS debugger, the VS debugger dies, but the chat application works.

How can I test and debug node.js from within a VS 2013 project and not have any conflicts as far as the port?

If I use a different port to listen on than what VS is using - I get to the chat client with no failure in the debugger, but the chat does not work.  I type messages and nothing shows up in the chat window.

Here is the current HTML code:
<!doctype html>
<html>
  <head>
    <title>Socket.IO chat</title>
    <style>
      * { margin: 0; padding: 0; box-sizing: border-box; }
      body { font: 13px Helvetica, Arial; }
      form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
      form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
      form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
      #messages { list-style-type: none; margin: 0; padding: 0; }
      #messages li { padding: 5px 10px; }
      #messages li:nth-child(odd) { background: #eee; }
    </style>
  </head>
  <body>
    <ul id="messages"></ul>
    <form action="">
      <input id="m" autocomplete="off" /><button>Send</button>
    </form>
    <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
    <script>
      var socket = io();
      $('form').submit(function(){
        socket.emit('chat message', $('#m').val());
        $('#m').val('');
        return false;
      });
      socket.on('chat message', function(msg){
        $('#messages').append($('<li>').text(msg));
      });
    </script>
  </body>
</html>

Open in new window



Here is the "server" JavaScript code used by nodeJS:
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
  socket.on('chat message', function(msg){
    io.emit('chat message', msg);
  });
});

http.listen(54665, function(){
  console.log('listening on *:54665');
});

Open in new window

LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
Hi mate.

First thing I would start using IIS instead of that IIS Express that is useless even for "normal" projects.

Second thing, have a look at this: https://www.visualstudio.com/features/node-js-vs
I think it's a much better resource that I would ever be explaining it here.

Let me know!
Tom KnowltonWeb developerAuthor Commented:
Alexander Simoes:

Thanks for your reply  I did end-up installing NTVS ...  but I am still struggling with port conflicts.
Alexandre SimõesManager / Technology SpecialistCommented:
And did you move to IIS instead of using IIS Express?

I don't know if that's the problem but it should worth a try.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
First, I'd like to get it all working inside of Visual Studio's IDE.
Tom KnowltonWeb developerAuthor Commented:
I'll accept this as a solution, because it is valid.

I hope someone will come back here and post steps to test node.js INSIDE the Visual Studio IDE -- particularly so that there are no port conflicts between the port (that the VS debugger uses) and the port that the node .js file is set to listen on.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.