This file contains 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
/*jslint white: true, devel: true, debug: true, onevar: true, | |
node: true, undef: true, nomen: true, regexp: false, | |
plusplus: false, bitwise: true, unparam: false, es5: true, | |
newcap: true, on: true, strict: true */ | |
(function (global, undefined) { | |
"use strict"; | |
require.paths = [ '/Users/Andreas/.node_modules', '/usr/local/lib/node_modules' ]; | |
This file contains 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'); | |
http.createServer(function (req, res) { | |
res.end(); | |
}).listen(1337, "127.0.0.1"); | |
console.log('emitter.js running'); |
This file contains 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
Andreas-Madsens-MacBook-Pro:~ Andreas$ cd Sites/WebNodes/interface/ | |
Andreas-Madsens-MacBook-Pro:interface Andreas$ node test.js | |
Output forever list: | |
Number of open processors: 0 | |
null | |
start emitter.js | |
emitter.js is started | |
Output forever list: | |
Number of open processors: 1 | |
[0] node /Users/Andreas/Sites/WebNodes/interface/emitter.js [4483, 4482] /Users/Andreas/Sites/WebNodes/interface/log/S9H7.log 0:0:0:0.38 |
This file contains 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
/*jslint white: true, devel: true, debug: true, onevar: true, | |
node: true, undef: true, nomen: true, regexp: false, | |
plusplus: false, bitwise: true, unparam: false, es5: true, | |
newcap: true, on: true, strict: true */ | |
(function (global, undefined) { | |
"use strict"; | |
//get the forever module | |
var forever = require("forever"), |
This file contains 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
console.log('Version: ' + process.version); | |
var dgram = require('dgram'), | |
path = require("path"); | |
var server = dgram.createSocket("unix_dgram"), | |
datagramPath = path.join(process.cwd(), "datagram_socket.udp"); | |
server.on("message", function (message) { | |
console.log("message event fired"); |
This file contains 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') | |
, httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
// | |
// Put your custom server logic here | |
// | |
proxy.proxyRequest(req, res, { | |
host: 'localhost', | |
port: 9000 |
This file contains 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') | |
, httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
// | |
// Put your custom server logic here | |
// | |
proxy.proxyRequest(req, res, { | |
host: 'localhost', | |
port: 9000 |
This file contains 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
// Copyright Joyent, Inc. and other Node contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// |
This file contains 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
// Copyright Joyent, Inc. and other Node contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// |
This file contains 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 cluster = require('cluster'); | |
var http = require('http'); | |
console.log(cluster.isMaster ? "master" : "worker" + " :: " + process.pid); | |
if (cluster.isMaster) { | |
// Fork workers. | |
cluster.setupMaster({workers: 1}); | |
cluster.on('fork', function (worker) { |
OlderNewer