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 io = {}; | |
io.Socket = function SocketIO(){ | |
var args = Array.prototype.slice.call(arguments, 0) | |
, fragments = typeof args[0] === 'string' ? args[0].split(':') : false | |
, options = typeof args[args.length -1] !== 'string' ? args[args.length -1] : {}; | |
this.host = document.domain; | |
this.options = { | |
secure: false |
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
/*! Socket.IO.js build:0.6.2, development. Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed */ | |
/** | |
* socket.io-node-client | |
* Copyright(c) 2011 LearnBoost <[email protected]> | |
* MIT Licensed | |
*/ | |
/** | |
* @namespace | |
*/ |
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
Copyright (c) 2011 Arnout Kazemier, <http://blog.3rd-Eden.com> | |
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 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 socket = new io.Socket(); | |
var clients = []; | |
socket.on('message', function(data){ | |
if (typeof data == 'object'){ | |
clients = data; | |
} else { | |
console.log(data); | |
socket.send({sessionid: clients[1], 'message': 'message'}) | |
} | |
}); |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Arnout Kazemier <blog.3rd-Eden.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 socket = new io.Socket(); | |
socket.on('message', function(data){ | |
alert(data); | |
}); | |
socket.connect() |
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 express = require('express') | |
, https = require('https'); | |
var app = express.createServer(); | |
app.listen(80); | |
// Build the https based part & read the key and crt file that is required to encrypt the server / client connection | |
var ssl = https.createServer({ | |
key: fs.readFileSync("./ssl/ssl.private.key").toString() | |
, cert: fs.readFileSync("./ssl/ssl.crt").toString() |
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
util.request = (function(){ | |
var fn = { | |
body: 'return null' | |
}; | |
if ('XDomainRequest' in window){ | |
fn.body = 'return new XDomainRequest();'; | |
fn.xdomain = true; | |
} else if ('XMLHttpRequest' in window) { | |
fn.body = 'return new XMLHttpRequest();'; |
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
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. | |
Trace: | |
at Socket.<anonymous> (events.js:126:17) | |
at XHRPolling.setHandlers (/Users/V1/Sites/socket.io-node/lib/transport.js:137:15) | |
at XHRPolling.<anonymous> (/Users/V1/Sites/socket.io-node/lib/transport.js:94:10) | |
at XHRPolling.<anonymous> (/Users/V1/Sites/socket.io-node/lib/transports/http.js:82:39) | |
at XHRPolling.handleRequest (/Users/V1/Sites/socket.io-node/lib/transports/http-polling.js:61:41) | |
at XHRPolling.request (/Users/V1/Sites/socket.io-node/lib/transport.js:40:8) | |
at Manager.handleClient (/Users/V1/Sites/socket.io-node/lib/manager.js:323:21) | |
at Manager.handleHTTPRequest (/Users/V1/Sites/socket.io-node/lib/manager.js:295:8) |