This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require("net"); | |
var sys = require("sys"); | |
var encoding = "utf8"; | |
var server = net.createServer(function (stream) { | |
stream.setEncoding(encoding); | |
stream.addListener('connect', function () { | |
remote = net.createConnection(5858, "localhost"); | |
remote.setEncoding(encoding); | |
remote.setTimeout(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 8c98d12474fbd9e17732ff84c47e48c0cc100928 Mon Sep 17 00:00:00 2001 | |
From: Andrew Johnston <[email protected]> | |
Date: Tue, 25 May 2010 10:30:58 +0100 | |
Subject: [PATCH] datagram support for socket connect | |
--- | |
lib/net.js | 14 ++++++++++++-- | |
src/node_net2.cc | 11 +++++++---- | |
2 files changed, 19 insertions(+), 6 deletions(-) | |
mode change 100644 => 100755 lib/net.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Buffer.prototype.pprint = function() { | |
var line = ""; | |
if(this.length > 0) { | |
for(var i=0; i<this.length; i++) { | |
if(i%8==0) { | |
sys.print(" "); | |
} | |
if(i%16==0) { | |
sys.print(line); | |
line = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastcgi.server = ( ".js" => | |
(( "socket" => "/tmp/js-fastcgi.socket", | |
"bin-path" => "/node-fastcgi/examples/responder.js", | |
"check-local" => "disable" | |
)) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef lint | |
static const char rcsid[] = "$Id: echo.c,v 1.5 1999/07/28 00:29:37 roberts Exp $"; | |
#endif /* not lint */ | |
#include "fcgi_config.h" | |
#include <stdlib.h> | |
#ifdef HAVE_UNISTD_H | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function IncomingMessage() { | |
var msg = this; | |
msg.headers = {}; | |
msg.complete = false; | |
} | |
IncomingMessage.prototype._addHeaderLine = function (field, value) { | |
var dest; | |
if (this.complete) { | |
dest = this.trailers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node.h> | |
#include <node_buffer.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <stdlib.h> | |
using namespace v8; | |
using namespace node; | |
static Persistent<String> on_call_sym; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var Script = process.binding('evals').Script; | |
var httpd = new http.Server(); | |
httpd.on("listening", function() { | |
console.log('Server running at http://0.0.0.0:8124/'); | |
}); | |
var context = { | |
"name": "billy" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var util = require("util"); | |
function walkSync(filename, cb) { | |
try { | |
var stat = fs.lstatSync(filename); | |
if(stat.isDirectory()) { | |
try { | |
if(cb(null, filename, stat)) { | |
var files = fs.readdirSync(filename); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var walk = require("./lib/walk.js"); | |
var counter = 0; | |
var dirs = 0; | |
var files = 0; | |
var then = new Date().getTime(); | |
process.argv.forEach(function(val, index, array) { | |
if (index > 1) { |