Title:
astro-spacesocket-a5dead8 Download
Description: WebSockets From Space*
* There are no users in space, only astronauts with the latest browser. Therefore no graceful fallback is attempted.
API
Setup
var server = http.createServer(...)
server.listen(port)
require( spacesocket ).attach(server, function(conn) {
dealWithWebSocket(conn)
})
Reading
conn.on( data , function(msg) {
doStuffWithString(msg)
})
Writing
conn.write( Hello, World )
Closure
conn.end()
Buffer control
conn.on( drain , function() {
// socket write queue is empty,
// send until queueing again:
while(conn.send(data)) { }
})
// Throttle sender for 1s:
conn.pause()
setTimeout(function() { conn.resume() }, 1000)
To Search:
File list (Check if you may need any files):
astro-spacesocket-a5dead8
.........................\LICENSE
.........................\README.md
.........................\lib
.........................\...\connection.js
.........................\...\framing.js
.........................\...\oldFraming.js
.........................\...\spacesocket.js
.........................\speedtest
.........................\.........\client.js
.........................\.........\graph.js
.........................\.........\index.html
.........................\.........\server.js
.........................\test
.........................\....\framing.test.js
.........................\....\oldFraming.test.js
.........................\....\spacesocket.test.js