<commit_before>var http = require( 'http' ); 
var server = http.createServer( function( req, res ) {
  var from = '';

  if ( req.connection.remoteAddress === '127.0.0.1' || req.connection.remoteAddress === 'localhost' ) { 
    from = req.headers['x-forwarded-for'];
  } else {
    from = req.connection.remoteAddress;
  }

  res.end( from + "\n" );
}).listen( 3013 );<commit_msg>geo working - need spatial stuff now<commit_after>var http = require( 'http' ),
geoip = require( 'geoip-lite' ),
server = http.createServer( function( req, res ) {
  var from = '', geo;

  if ( req.connection.remoteAddress === '127.0.0.1' || req.connection.remoteAddress === 'localhost' ) { 
    from = req.headers['x-forwarded-for'] || '127.0.0.1';
  } else {
    from = req.connection.remoteAddress;
  }

  if ( req.url === '/geo' ) {
    geo = geoip.lookup( from ) || {};
    geo.ip = from;
    res.end( JSON.stringify(geo) );
  } else if ( req.url === '/mirror' ) {
    geo = geoip.lookup( from ) || {};
    // lookup in the mirror db 
  } else {
    res.end( from + "\n" );
  }

}).listen( 3013 );
{'fraction_non_alphanumeric': 0.1977818853974122, 'fraction_numerical': 0.024029574861367836, 'mean_word_length': 2.9097472924187726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '2513220', 'n_tokens_mistral': 401, 'n_tokens_neox': 374, 'n_words': 86}