mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
added networking tests
This commit is contained in:
parent
bcde1d3171
commit
620f2626a3
506 changed files with 228337 additions and 0 deletions
12
networking/node_modules/socket.io/support/node-websocket-client/examples/client-unix.js
generated
vendored
Normal file
12
networking/node_modules/socket.io/support/node-websocket-client/examples/client-unix.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
var sys = require('sys');
|
||||
var WebSocket = require('../lib/websocket').WebSocket;
|
||||
|
||||
var ws = new WebSocket('ws+unix://' + process.argv[2], 'boffo');
|
||||
|
||||
ws.addListener('message', function(d) {
|
||||
sys.debug('Received message: ' + d.toString('utf8'));
|
||||
});
|
||||
|
||||
ws.addListener('open', function() {
|
||||
ws.send('This is a message', 1);
|
||||
});
|
||||
10
networking/node_modules/socket.io/support/node-websocket-client/examples/client.js
generated
vendored
Normal file
10
networking/node_modules/socket.io/support/node-websocket-client/examples/client.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
var sys = require('sys');
|
||||
var WebSocket = require('../lib/websocket').WebSocket;
|
||||
|
||||
var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
|
||||
ws.addListener('data', function(buf) {
|
||||
sys.debug('Got data: ' + sys.inspect(buf));
|
||||
});
|
||||
ws.onmessage = function(m) {
|
||||
sys.debug('Got message: ' + m);
|
||||
}
|
||||
13
networking/node_modules/socket.io/support/node-websocket-client/examples/server-unix.js
generated
vendored
Normal file
13
networking/node_modules/socket.io/support/node-websocket-client/examples/server-unix.js
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
var sys = require('sys');
|
||||
var ws = require('websocket-server/ws');
|
||||
|
||||
var srv = ws.createServer({ debug : true});
|
||||
srv.addListener('connection', function(s) {
|
||||
sys.debug('Got a connection!');
|
||||
|
||||
s._req.socket.addListener('fd', function(fd) {
|
||||
sys.debug('Got an fd: ' + fd);
|
||||
});
|
||||
});
|
||||
|
||||
srv.listen(process.argv[2]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue