Skip to content

Instantly share code, notes, and snippets.

// http://mape.me:8081/static/js/test.js
// http://mape.me:8081/static/css/test.css
var sys = require('sys');
var Connect = require('Connect/lib/connect');
var AssetsManager = require('./assetsManager');
new Connect.Server([
,{filter: 'log'}
,{filter: 'gzip'}
# UPDATE
# Fix: http://gist.github.com/432072
# make CFLAGS="-fPIC" CXXFLAGS="-fPIC"
node-waf configure && \
node-waf build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
var child_process = require('child_process'),
sys = require('sys'),
net = require('net'),
netBinding = process.binding('net');
var fd = netBinding.socket('tcp4');
netBinding.bind(fd, 8080);
netBinding.listen(fd, 128);
for (var i = 0; i < 4; i++) {
#creationix
23:48:10 < mape> Requests per second: 6985.85 [#/sec] (mean)
23:48:25 < mape> Requests per second: 13420.92 [#/sec] (mean)
23:48:34 < mape> Requests per second: 19375.66 [#/sec] (mean)
23:48:44 < mape> Requests per second: 23868.80 [#/sec] (mean)
#pgriess
22:10:51 < mape> Requests per second: 22466.00 [#/sec] (mean), neat
#ab -n 50000 -c 200 http://127.0.0.1:3000/
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
Document Path: /
Document Length: 574 bytes
Concurrency Level: 200
mape@dunderklumpen:~/.node_libraries/Connect/examples/multitouch$ uname -a
Linux dunderklumpen 2.6.26-2-amd64 #1 SMP Tue Mar 9 22:29:32 UTC 2010 x86_64 GNU/Linux
// The multitouch app has {filter: "log"} disabled.
mape@dunderklumpen:~/.node_libraries/Connect/examples/multitouch$ connect -n 4 -p 9999 app
DEBUG: Child spawned 23370
DEBUG: Child spawned 23371
DEBUG: Child spawned 23372
DEBUG: Child spawned 23373
Connect server listening on http://*:9999 in development mode
mape@dunderklumpen:~$ sudo npm install connect@latest
[sudo] password for mape:
npm it worked if it ends with ok
npm sudo true
npm configfile /home/mape/.npmrc
npm cli [ 'install', 'connect@latest' ]
npm version 0.1.16
npm install pkg connect@latest
npm fetch data connect
npm GET connect
Caught exception: Error: Uncaught, unspecified 'error' event.
Error: Uncaught, unspecified 'error' event.
at Client.emit (events:13:15)
at Client.<anonymous> (/home/mape/.node_libraries/.npm/irc/0.1.2/package/lib/irc.js:674:26)
at Client.emit (events:42:20)
at /home/mape/.node_libraries/.npm/irc/0.1.2/package/lib/irc.js:721:18
at Array.forEach (native)
at Stream.<anonymous> (/home/mape/.node_libraries/.npm/irc/0.1.2/package/lib/irc.js:719:15)
at Stream.emit (events:25:26)
at IOWatcher.callback (net:505:33)
Failed update, frigg lacks coordinates.
Fetching position for MrWarGames@**.***.**.**
at new Connecton (/usr/local/lib/node/.npm/websocket-serv/er/1.3.00/package/lib/ws/connection.js:100:12) at Server.<anonymous> (/usr/local/lib/node/.npm/websocket-server/1.3.00/package/lib/ws.js:65:7) at Server.emit
(events:42:20) at Stream.<anonymous> (http:772:14) at IOWatcher.callback (net:515:29) at node.js:255:9
Caught exception: TypeError: undefined is not a function
TypeError: undefined is not a function at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native) at Object.createHash (crypto:3638:10) at Connection.<anonymous>
(/usr/local/lib/node/.npm/websocket-server/1.3.00/package/lib/ws/connection.js:335:25) at Connection.handshake (/usr/local/lib/node/.npm/websocket-server/1.3.00/package/lib/ws/connection.js:284:31)
exports.minify = function(html)
{
return html.replace(/>(\n| | )*</g,'><').replace(/[a-z-]+=""/g,'').replace(/"([^ ]*)"/g, '$1').replace(/<\/li>/,'');
};