<commit_before>var express = require('express');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);

var quotr = require('./quotr/quotr');

app.use('/', express.static(__dirname+'/html'));
app.use('/dist', express.static(__dirname+'/dist'));

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

var curStockCode;
io.on('connection', function(socket) {
  console.log('A user connected');

  socket.on('register_code', function(code) {
    curStockCode = code;
    console.log('Registered code: ' + code);
    io.emit('register_code','success');

    quotr.getQuote(code, function(err, quote) {
      if (err) {
        console.log('Error in getting quote. Error: '+err);
      }
      else {
        io.emit('quote', quote);
      }
    });
  });
});

server.listen(8080, '192.168.187.130', function() {
  console.log('App started at port 8080.');
});<commit_msg>Unicast instead of broadcast<commit_after>var express = require('express');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);

var quotr = require('./quotr/quotr');

app.use('/', express.static(__dirname+'/html'));
app.use('/dist', express.static(__dirname+'/dist'));

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

var curStockCode;
io.on('connection', function(socket) {
  console.log('A user connected');

  socket.on('register_code', function(code) {
    var thisSocket = this;
    curStockCode = code;
    console.log('Registered code: ' + code);
    thisSocket.emit('register_code','success');

    quotr.getQuote(code, function(err, quote) {
      if (err) {
        console.log('Error in getting quote. Error: '+err);
      }
      else {
        thisSocket.emit('quote', quote);
      }
    });
  });
});

server.listen(8080, '192.168.187.130', function() {
  console.log('App started at port 8080.');
});
{'fraction_non_alphanumeric': 0.20102564102564102, 'fraction_numerical': 0.020512820512820513, 'mean_word_length': 3.926767676767677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '698216', 'n_tokens_mistral': 666, 'n_tokens_neox': 627, 'n_words': 126}