<commit_before>#!/usr/bin/env node
var express = require('express')
  , fs = require('fs')
  , http = require('http')
  , https = require('https')
  , spdy = require('spdy');

// Set up server private key, public key certificate and CA certificate
// The ciphers options prevents using some ciphers not supported by Wireshark, such as DH and CAMELLIA
var sslOptions = {
  key: fs.readFileSync(__dirname + '/../ssh/localhost.key'),
  cert: fs.readFileSync(__dirname + '/../ssh/localhost.crt'),
  ca: fs.readFileSync(__dirname + '/../ca/cacert.pem'),
  ciphers: 'HIGH:!DSS:!DH:!CAMELLIA:!aGOST:!AESGCM:!aNULL@STRENGTH'
};

var app = express();
app.configure(function () {
  app.use(express.logger("dev"));
  app.use(express.cookieParser());
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.enable('trust proxy');
});

// Hello World
app.get('/hello', function (request, response) {
  response.set('Content-Type', 'text/plain');
  response.send('Hello World');
});

// Serve files from the app/static directory
app.get('/*', function (request, response) {
  response.sendfile('app/static' + request.path);
});

var httpPort = 8080;
http.createServer(app).listen(httpPort);

var httpsPort = 8443;
https.createServer(sslOptions, app).listen(httpsPort);

var spdyPort = 10443;
spdy.createServer(sslOptions, app).listen(spdyPort);

console.log('Server listening on HTTP port ' + httpPort + ', HTTPS port ' + httpsPort + ', and SPDY port ' + spdyPort);
<commit_msg>SPDY Server Push of a single file<commit_after>#!/usr/bin/env node
var express = require('express')
  , fs = require('fs')
  , http = require('http')
  , https = require('https')
  , spdy = require('spdy');

// Set up server private key, public key certificate and CA certificate
// The ciphers options prevents using some ciphers not supported by Wireshark, such as DH and CAMELLIA
var sslOptions = {
  key: fs.readFileSync(__dirname + '/../ssh/localhost.key'),
  cert: fs.readFileSync(__dirname + '/../ssh/localhost.crt'),
  ca: fs.readFileSync(__dirname + '/../ca/cacert.pem'),
  ciphers: 'HIGH:!DSS:!DH:!CAMELLIA:!aGOST:!AESGCM:!aNULL@STRENGTH'
};

var app = express();
app.configure(function () {
  app.use(express.logger("dev"));
  app.use(express.cookieParser());
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.enable('trust proxy');
});

// Hello World
app.get('/hello', function (request, response) {
  response.set('Content-Type', 'text/plain');
  response.send('Hello World');
});

// When the '/tw.html' home page is requested as '/', push some static resources as well
app.get('/', function (request, response) {
  if (response.push) {
    response.push('/thoughtWorks_files/jquery.min.js', {'content-type':'text/javascript'}, function(error, stream) {
      if (error) throw error;
      stream.end(fs.readFileSync(__dirname + '/../static/thoughtWorks_files/jquery.min.js'));
    });
  }
  response.sendfile('app/static/tw.html');
});

// Serve files from the app/static directory
app.get('/*', function (request, response) {
  response.sendfile('app/static' + request.path);
});

var httpPort = 8080;
http.createServer(app).listen(httpPort);

var httpsPort = 8443;
https.createServer(sslOptions, app).listen(httpsPort);

var spdyPort = 10443;
spdy.createServer(sslOptions, app).listen(spdyPort);

console.log('Server listening on HTTP port ' + httpPort + ', HTTPS port ' + httpsPort + ', and SPDY port ' + spdyPort);

{'fraction_non_alphanumeric': 0.17473503294185047, 'fraction_numerical': 0.007447722715554283, 'mean_word_length': 4.6231884057971016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '631538', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1146, 'n_words': 263}