<commit_before>'use strict';

var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({ port: 8899 });

wss.on('connection', function connection(ws) {
  console.log('client connected: ', ws);
  ws.on('message', function incoming(message) {
    console.log('--> %s', message);
    message = JSON.parse(message);
    // Send the callback
    var data = JSON.stringify({ id: message.id, status: 'complete' });
    console.log('<--', data);
    ws.send(data);
  });<commit_msg>Log client IP address on connection.<commit_after>'use strict';

var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({ port: 8899 });

wss.on('connection', function connection(ws) {
  console.log('client connected: ', ws.upgradeReq.connection.remoteAddress);
  ws.on('message', function incoming(message) {
    console.log('--> %s', message);
    message = JSON.parse(message);
    // Send the callback
    var data = JSON.stringify({ id: message.id, status: 'complete' });
    console.log('<--', data);
    ws.send(data);
  });
{'fraction_non_alphanumeric': 0.18059558117195004, 'fraction_numerical': 0.007684918347742555, 'mean_word_length': 4.158415841584159, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4028030', 'n_tokens_mistral': 327, 'n_tokens_neox': 313, 'n_words': 81}