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
➜ test sudo npm install test-sigar-gyp --verbose | |
npm info it worked if it ends with ok | |
npm verb cli [ '/Users/shripadk/node/bin/node', | |
npm verb cli '/Users/shripadk/node/bin/npm', | |
npm verb cli 'install', | |
npm verb cli 'test-sigar-gyp', | |
npm verb cli '--verbose' ] | |
npm info using [email protected] | |
npm info using [email protected] | |
npm verb read json /Users/shripadk/Test/package.json |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'sigar', | |
'conditions': [ | |
['OS=="win"', { | |
'build': '<!(echo windows))' | |
}, { | |
'build': '<!(sudo cp -rp <(module_root_dir)/deps/sigar <(module_root_dir)/build/sigar && cd <(module_root_dir)/build/sigar && sudo ./autogen.sh && sudo ./configure --prefix=<(module_root_dir)/build/Release --with-pic && sudo make && sudo make install))', | |
'sources': ['src/node_sigar.cc'], |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'sigar', | |
'conditions': [ | |
['OS=="win"', { | |
'build': '<!(echo windows))' | |
}, { | |
'build': '<!(sudo cp -rp <(module_root_dir)/deps/sigar <(module_root_dir)/build/sigar && cd <(module_root_dir)/build/sigar && ./autogen.sh && ./configure --prefix=<(module_root_dir)/build/Release --with-pic && make && make install))', | |
'sources': ['src/node_sigar.cc'], |
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
Manager.prototype.initStore = function () { | |
this.handshaken = {}; | |
this.connected = {}; | |
this.open = {}; | |
this.closed = {}; | |
this.rooms = {}; | |
this.roomClients = {}; | |
var self = this; |
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
Transport.prototype.end = function (reason) { | |
if (!this.disconnected) { | |
this.log.info('transport end (' + reason + ')'); | |
var local = this.manager.transports[this.id]; | |
this.close(); | |
this.clearTimeouts(); | |
this.disconnected = true; |
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 Route = function(pattern, callback) { | |
this.pattern = pattern; | |
this.callback = callback; | |
}; | |
Route.prototype.matches = function(url) { | |
var params = {}; | |
if(!url.length) return false; | |
if(url[url.length-1] === "/") { | |
url = url.slice(0, url.length-1); |
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
ZQueue = function() { | |
this.queue = []; | |
this.queued = false; | |
}; | |
ZQueue.prototype.dequeue = function() { | |
this.queued = false; | |
this.shiftQueue(); | |
}; |
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
#!/usr/bin/env node | |
var os = require('os'); | |
var WebSocketClient = require('websocket').client; | |
var count = 0; | |
function recursion() { | |
var client = new WebSocketClient(); | |
client.on('connectFailed', function(error) { |
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'); | |
var sockjs = require('sockjs'); | |
var node_static = require('node-static'); | |
var sockjs_opts = {sockjs_url: "http://127.0.0.1:8888/sockjs.js"}; | |
var sockjs_echo = sockjs.createServer(sockjs_opts); | |
sockjs_echo.on('connection', function(conn) { | |
console.log(conn.id + ' connected'); | |
conn.on('data', function(message) { |
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
// run sockjs server on port 9999 | |
// use an old browser (ex: FF 3.5) which connects via polling transport | |
// frontend on 8888 | |
bouncy(function (req, bounce) { | |
if(headers.hasOwnProperty('upgrade')) { | |
// check if the request for upgrade is for websocket | |
// else just destroy the socket |