<commit_before>net = require( 'net' );

var clients = [];

var socket = net.createServer( function ( socket ) {
  socket.name = socket.remoteAddress + ":" + socket.remotePort;
  socket.id = clients.length;
  clients.push( socket );
  console.log( "connected to client " + socket.name );

  var clientID = new Buffer( [ 255, clients.length - 1 ] );
  socket.write( clientID );
  var clientJoinMsg = new Buffer( [ 254, clients.length - 1 ] );
  relay( clientJoinMsg, socket );

  socket.on( 'data', function( data ) {
    console.log( data );
    relay( data, socket );
  } );

  socket.on( 'end', function() {
    clients.splice( clients.indexOf( socket ), 1 );
    // relay leave event
    console.log( "client " + socket.name + " left the game." );
  } );

  function relay( data, sender ) {
    clients.forEach( function( client ) {
      if ( client == sender ) return;
      var posID = new Buffer( [ 253, sender.id ] );
      client.write( posID );
      client.write( data );
    } );
  }
} ).listen( process.env.PORT || 5000, null );<commit_msg>use port 80 instead. Sigh...<commit_after>net = require( 'net' );

var clients = [];

var socket = net.createServer( function ( socket ) {
  socket.name = socket.remoteAddress + ":" + socket.remotePort;
  socket.id = clients.length;
  clients.push( socket );
  console.log( "connected to client " + socket.name );

  var clientID = new Buffer( [ 255, clients.length - 1 ] );
  socket.write( clientID );
  var clientJoinMsg = new Buffer( [ 254, clients.length - 1 ] );
  relay( clientJoinMsg, socket );

  socket.on( 'data', function( data ) {
    console.log( data );
    relay( data, socket );
  } );

  socket.on( 'end', function() {
    clients.splice( clients.indexOf( socket ), 1 );
    // relay leave event
    console.log( "client " + socket.name + " left the game." );
  } );

  function relay( data, sender ) {
    clients.forEach( function( client ) {
      if ( client == sender ) return;
      var posID = new Buffer( [ 253, sender.id ] );
      client.write( posID );
      client.write( data );
    } );
  }
} ).listen( process.env.PORT || 80, null );
{'fraction_non_alphanumeric': 0.16060462919225318, 'fraction_numerical': 0.015115729806329713, 'mean_word_length': 2.8300180831826403, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6132393', 'n_tokens_mistral': 700, 'n_tokens_neox': 669, 'n_words': 186}