Skip to content

Instantly share code, notes, and snippets.

View Octalbyte's full-sized avatar
🐙
🦀 🇧🇷

Octalbyte

🐙
🦀 🇧🇷
  • Earth
View GitHub Profile
@y-a-v-a
y-a-v-a / server.js
Last active November 11, 2020 14:58
Nodejs php web server
//Lets require/import the HTTP module
var http = require('http');
var fs = require('fs');
var PORT=8080;
var spawn = require('child_process').spawn;
//We need a function which handles requests and send response
function handleRequest(request, response) {
@creationix
creationix / chatServer.js
Created November 19, 2010 20:47
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client