- Introduction
- Goals
- Level Flow
- Versions
- Stats
- Breakpoints
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 httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
var buffer = httpProxy.buffer(req); | |
middleware(res, function() { | |
console.log("The request was proxied"); | |
}); | |
proxy.on('proxyError', function () { |
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 express = require('express'); | |
var app = express(); | |
var server = require('http').createServer(app); | |
var io = require('socket.io').listen(server); | |
var users = {}; | |
app.listen(80); | |
app.get('/', function handler (req, res) { |
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'), | |
https = require('https'), | |
httpProxy = require('./lib/node-http-proxy'); | |
var server = httpProxy.createServer({ | |
target: { host: 'graph.facebook.com', port: 443, https: true }, | |
changeOrigin: true }, | |
function (req, res, proxy) { | |
console.log("Received request."); | |
server.proxy.response_buffer = ''; |
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
#!/usr/bin/env node | |
var path = require('path'), | |
spawn = require('child_process').spawn, | |
http = require('http'); | |
var PORT = 8080; | |
var PROXY_PORT = 8090; | |
var test = process.argv[2]; |
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
~/projects/test -bash$ node testserver.js | |
-------------- This is testing in curl | |
{ act: 'get' } | |
pushing get request | |
{ act: 'get' } | |
pushing get request | |
{ act: 'send' } | |
Writing data..... | |
Writing data..... | |
------------- This is testing with Chrome |
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 https = require('https'), | |
http = require('http'), | |
util = require('util'), | |
colors = require('colors'), | |
httpProxy = require('../node-http-proxy/lib/node-http-proxy'), | |
helpers = require('../node-http-proxy/test/helpers'); | |
//just uses readFileSync to load keys | |
var opts = helpers.loadHttps(); |
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 <sys/time.h> | |
int main( int argc, char* argv[] ) { | |
int a; | |
struct timeval starttv, endtv; | |
time_t totalsec, totalusec, startsec, startusec; | |
double pps, totaltime; |
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 path = require('path'); | |
var union = require('union'); | |
var ecstatic = require('ecstatic'); | |
//super simple static file server | |
union.createServer({ before: [ | |
ecstatic(path.join(__dirname, 'public')) | |
]}).listen(8080); | |
console.log('Server started!'); |
NewerOlder