-
-
Save anonymous/9d8140fbf69efc468638 to your computer and use it in GitHub Desktop.
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
/** | |
* TypeError: #<XHR> is not a function Moo server , Socket.io 1.0.0-pre | |
* mootools | |
* socket.io ver 1.0.0-pre | |
* | |
**/ | |
// require moo | |
// require('mootools'); | |
var io = require('socket.io'), | |
http = require('http'), | |
primish = require('primish'), | |
options = require('primish/options'); | |
var socketServer = primish({ | |
implement: options, | |
options: { | |
servPort: 8080 | |
}, | |
constructor: function(options){ | |
this.setOptions(options); | |
this.server = null; | |
this.connectSocket(); | |
}, | |
connectSocket: function(){ | |
this.server = io(http.Server()).listen(this.options.servPort); | |
this.server.on('connection', this.handleConnect.bind(this)); | |
}, | |
handleConnect: function(){ | |
console.log('got a connection on ' + this.options.servPort); | |
} | |
}); | |
var app = new socketServer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment