<commit_before>var http = require('http'),
	sio = require('socket.io'),
	static = require('node-static');

var PORT = process.argv[2];

var fileServer = new static.Server('./public');
var server = http.createServer(function (request, response) {
    request.addListener('end', function () {
        fileServer.serve(request, response);
    });
});
server.listen(PORT, "127.0.0.1");

console.log('Server running at http://127.0.0.1:' + PORT);

var io = sio.listen(server);
var nicknames = {};
var issues = [];

io.sockets.on('connection', function(socket) {
	
	io.sockets.emit('issues', issues);
	
	socket.on('user message', function(msg) {
		io.sockets.emit('user message', socket.nickname, msg);
	});
	
	socket.on('close issue', function(id) {
		issues[id].closed = true;
		io.sockets.emit('issue closed', socket.nickname, id);
	});
	
	socket.on('new issue', function(desc) {
		var newIssue = {
			id: issues.length,
			description: desc,
			creator: socket.nickname,
			assignee: null,
			closed: false
		};
		issues.push(newIssue);
		io.sockets.emit('issue created', newIssue);
	});

	socket.on('nickname', function(nick, fn) {
		if (nicknames[nick]) {
			fn(true);
		} else {
			fn(false);
			nicknames[nick] = socket.nickname = nick;
			socket.broadcast.emit('announcement', nick + ' connected');
			io.sockets.emit('nicknames', nicknames);
		}
	});

	socket.on('disconnect', function() {
		if (!socket.nickname) {
			return;
		}

		delete nicknames[socket.nickname];
		socket.broadcast.emit('announcement', socket.nickname + ' disconnected');
		socket.broadcast.emit('nicknames', nicknames);
	});
});<commit_msg>Get rid of hard-coded 127.0.0.1.<commit_after>var http = require('http'),
	sio = require('socket.io'),
	static = require('node-static');

var PORT = process.argv[2];

var fileServer = new static.Server('./public');
var server = http.createServer(function (request, response) {
    request.addListener('end', function () {
        fileServer.serve(request, response);
    });
});
server.listen(PORT);

console.log('Server running at http://127.0.0.1:' + PORT);

var io = sio.listen(server);
var nicknames = {};
var issues = [];

io.sockets.on('connection', function(socket) {
	
	io.sockets.emit('issues', issues);
	
	socket.on('user message', function(msg) {
		io.sockets.emit('user message', socket.nickname, msg);
	});
	
	socket.on('new issue', function(desc) {
		var newIssue = {
			id: issues.length,
			description: desc,
			creator: socket.nickname,
			assignee: null,
			closed: false
		};
		issues.push(newIssue);
		io.sockets.emit('issue created', newIssue);
	});
	
	socket.on('close issue', function(id) {
		issues[id].closed = true;
		io.sockets.emit('issue closed', socket.nickname, id);
	});

	socket.on('nickname', function(nick, fn) {
		if (nicknames[nick]) {
			fn(true);
		} else {
			fn(false);
			nicknames[nick] = socket.nickname = nick;
			socket.broadcast.emit('announcement', nick + ' connected');
			io.sockets.emit('nicknames', nicknames);
		}
	});

	socket.on('disconnect', function() {
		if (!socket.nickname) {
			return;
		}

		delete nicknames[socket.nickname];
		socket.broadcast.emit('announcement', socket.nickname + ' disconnected');
		socket.broadcast.emit('nicknames', nicknames);
	});
});
{'fraction_non_alphanumeric': 0.18352868599629857, 'fraction_numerical': 0.008019740900678593, 'mean_word_length': 4.197115384615385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '1288914', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1085, 'n_words': 211}