Skip to content

Instantly share code, notes, and snippets.

View redneck-f25's full-sized avatar

Daniel Hammerschmidt redneck-f25

  • Leipzig, Germany
View GitHub Profile
@graphicbeacon
graphicbeacon / chat-server.js
Last active October 10, 2023 16:37
A simple TCP chat server with NodeJS, based on the example provided by creationix.
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;