How to implement socket.io in order to make basic example multiplayer?

I would like to use socket.io in order to add a multiplayer element to this game- I'm guessing I need the advancePlayer function to be called by the server which will somehow update the clients but I am not sure how to do this. I have setup a basic nodeJS server. Any help would be greatly appreciated

main.js

$(document).ready(function() {
  var end_of_track = 15;
  var players = [
    {
      id: 1,
      position: 0,
      keycode: 80,
      css_locator: '#player1_strip'
    },
    {
      id: 2,
      position: 0,
      keycode: 81,
      css_locator: '#player2_strip'
    }
  ];

  function advancePlayer(keyCode) {
    players.forEach(function(player){
      if (keyCode == player.keycode && players[0].position < end_of_track && players[1].position < end_of_track) {
        move_player(player.css_locator);
        player.position++;
        winner(player.position, player.id);
      }
    });
  }

  $(document).keyup(function(e) {
    advancePlayer(e.keyCode);
  });
});

function move_player(strip) {
  $(strip).find('td.active').removeClass('active').next().addClass('active');
}

function winner(player, num) {
  if (player > 14) {
    alert("Player " + num + " has won!");
  }
}

index.html

<html>
<head>
  <title>Drag Racing</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="main.js"></script>
  <link rel="stylesheet" href="racer_table.css" type="text/css" />
</head>
<body>
<h1>Drag Racing Sim</h1>
<table class="racer_table">
  <tr id="player1_strip">
    <td class="active"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>FINISH</td>
  </tr>
  <tr id="player2_strip">
    <td class="active"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>LINE</td>
  </tr>
</table>
</body>

css

body {
  font-family: 'Helvetica', sans-serif;
}

h1 {
  text-align: center;
}

.description {
  height: 80px;
  width: 500px;
  margin: 0 auto;
}

.racer_table {
  width: 1400px;
  margin: 0 auto;
  border: solid 3px;
}
.racer_table td {
  background-color: white;
  height: 90px;
  width: 64px;
  text-align: center;
}

.racer_table td.active {
  background-color: black;
}