Permalink
Browse files

tidy up

  • Loading branch information...
1 parent 173bccc commit be3e244854555bf77911dede90c7ae922ac74672 @billywhizz committed Feb 7, 2014
Showing with 14 additions and 15 deletions.
  1. +9 −9 examples/proxy.js
  2. +3 −3 examples/staticd.js
  3. +2 −3 examples/test-ws.js
View
@@ -3,10 +3,10 @@ var pprint = require("../lib/utils").pprint;
var sock = new minsock.TCP();
var config = {
host: "0.0.0.0",
- port: 443,
- remotehost: "46.231.112.170",
+ port: 80,
+ remotehost: "212.58.244.70",
remoteport: 80,
- secure: true,
+ secure: false,
cert: "./cert.pem",
key: "./key.pem",
ca: "./owner.net.pem"
@@ -35,14 +35,14 @@ sock.onconnection = function(peer) {
backend.kill();
return;
}
- console.log("backend.onread: " + len);
- pprint(buf, start, len, process.stdout);
+ //console.log("backend.onread: " + len);
+ //pprint(buf, start, len, process.stdout);
peer.send(buf.slice(start, start + len), function(status, handle, req) {
if(status !== 0) {
peer.kill();
return;
}
- console.log("peer.send: " + len + ":" + status);
+ //console.log("peer.send: " + len + ":" + status);
});
};
backend.readStart();
@@ -78,8 +78,8 @@ sock.onconnection = function(peer) {
peer.kill();
return;
}
- console.log("peer.onread: " + len);
- pprint(buf, start, len, process.stdout);
+ //console.log("peer.onread: " + len);
+ //pprint(buf, start, len, process.stdout);
var b = new Buffer(len);
buf.copy(b, 0, start, start + len);
if(peer.backend && !peer.backend.closed) {
@@ -88,7 +88,7 @@ sock.onconnection = function(peer) {
peer.backend.kill();
return;
}
- console.log("backend.send: " + len + ":" + status);
+ //console.log("backend.send: " + len + ":" + status);
});
}
else {
View
@@ -5,8 +5,8 @@ var FileCache = require("../").filecache.FileCache;
var config = {
httpd: {
host: "0.0.0.0",
- port: 9000,
- secure: true,
+ port: 80,
+ secure: false,
cert: "../../../cert.pem",
key: "../../../key.pem"
},
@@ -54,4 +54,4 @@ httpd.onError = function(err) {
rc = httpd.listen(4096);
if(rc !== 0) {
process.exit(1);
-}
+}
View
@@ -1,13 +1,12 @@
require("../");
-var sock = new WebSocket("wss://websocket.mtgox.com/mtgox?Currency=USD");
+var sock = new WebSocket("ws://ws.blockchain.info/inv");
function heading(m) {
console.log("\x1B[32m" + m + "\x1B[39m");
}
sock.onopen = function() {
heading("onopen");
sock.send(JSON.stringify({
- op: "unsubscribe",
- channel: "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe"
+ op: "unconfirmed_sub"
}));
};
sock.onclose = function() {

0 comments on commit be3e244

Please sign in to comment.