Node.js

Node.js est un canevas événementiel pour réaliser des applications serveur en Javascript.

HTTP script
var http = require("http");

function onRequest(request, response) { console.log("Receiving a request"); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end; }

http.createServer(onRequest).listen(8888); console.log("Server started. ^C to kill it");

node hello.js

UDP Datagrams
var dgram = require("dgram");

var server = dgram.createSocket("udp4");

server.on("message", function (msg, rinfo) { console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port); });

server.on("listening", function {  var address = server.address;  console.log("server listening " + address.address + ":" + address.port); });

server.bind(41234); // server listening 0.0.0.0:41234

node dgram.js