[Pharo-project] little challenge for sven and us

Stéphane Ducasse stephane.ducasse at inria.fr
Thu Jun 30 11:07:14 EDT 2011

Hi guys

apparently people get excited by nodeJS and I would like to know the equivalence of

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res .end('Hello World\n');
}).listen(1337, "");

console.log('Server running at');
To run the server, put the code into a file example.js and execute it with the node program:

% node example.js
Server running at

Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');
var server = net.createServer(function (socket) {
  socket.write("Echo server\r\n");

server.listen(1337, "");

we should communicate better :)


More information about the Pharo-dev mailing list