Skip to content

Instantly share code, notes, and snippets.

View szul's full-sized avatar
💻

Michael Szul szul

💻
View GitHub Profile
// gopher.js - a minimal gopher implementation using node.js
// Released under the 3 clause BSD license by Matt Croydon <mcroydon@gmail.com> (http://postneo.com)
var net = require('net');
net.createServer(function (socket) {
socket.setEncoding("ascii");
socket.on("data", function (data) {
if (data === '\r\n') {
console.log('Serving index.');