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
var http = require('http'); | |
var WebSocketServer = require('websocket').server; | |
var port = 8080; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var index = '<!DOCTYPE html><html><head><title>stdin-to-ws</title></head>' | |
+ '<body><div id="msg"></div><script>' | |
+ 'var msg = document.getElementById("msg");' | |
+ 'var ws = new WebSocket("ws:localhost:8080/stdin-to-ws", "stdin-to-ws");' |
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
--- node_modules/tower/node_modules/superagent/lib/node/index.js.org 2012-06-03 04:27:15.000000000 +0900 | |
+++ node_modules/tower/node_modules/superagent/lib/node/index.js 2012-06-13 10:07:53.142584979 +0900 | |
@@ -458,6 +458,29 @@ | |
// initiate request | |
var mod = exports.protocols[url.protocol]; | |
+ // use proxy | |
+ if(process.env.http_proxy) { | |
+ var proxy = parse(process.env.http_proxy); | |
+ if (url.protocol === 'http:') { |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <assert.h> | |
#include "uv.h" | |
#define MAX_CONSUMERS 16 | |
#define MAX_LOOPS 100 |
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
var app = require('express').createServer(),io = require('socket.io').listen(app),http = require('http'); | |
app.listen(8080); | |
app.get('/', function (req, res) { | |
res.sendfile(__dirname + '/index.html'); | |
}); | |
io.sockets.on('connection', function (socket) { | |
var options = { | |
host: 'www.google.com', |
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
var fs = require('fs'); | |
var http = require('http'); | |
var util = require('util'); | |
var file = './1G.file'; | |
var stat = fs.statSync(file); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'octet-stream/binary', | |
'Content-Length': stat.size | |
}); | |
var rStream = fs.createReadStream(file); |
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
Certificate: | |
Data: | |
Version: 3 (0x2) | |
Serial Number: | |
04:00:00:00:00:01:31:89:c6:44:c9 | |
Signature Algorithm: sha256WithRSAEncryption | |
Issuer: OU=GlobalSign Root CA - R3, O=GlobalSign, CN=GlobalSign | |
Validity | |
Not Before: Aug 2 10:00:00 2011 GMT | |
Not After : Aug 2 10:00:00 2022 GMT |
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
var stream = require('stream'); | |
var express = require('express'); | |
var multiparty = require('multiparty'); | |
var app = express(); | |
var maxlimit = 2 * 1024 * 1024; // 2M byte | |
var postHandler = function(req, res, next) { | |
var length = 0; | |
var buflist = []; | |
var content_length = req.get('content-length'); |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Ajax GET Test</title> | |
<script> | |
window.addEventListener('DOMContentLoaded', function() { | |
if (window.chrome.loadTimes().npnNegotiatedProtocol) { | |
var protocol = document.getElementById("protocol"); | |
protocol.innerHTML = window.chrome.loadTimes().npnNegotiatedProtocol; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <queue> | |
#include "uv.h" | |
using namespace std; | |
uv_loop_t *loop; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include "uv.h" | |
uv_loop_t *loop; | |
uv_async_t async; | |
static int closed = 0; | |
static int async_called = 0; | |
void print_progress(uv_async_t *handle, int status /*UNUSED*/) { |
NewerOlder