<commit_before>#!/usr/bin/env node
var http = require('http')
var request = require('request')

var port = process.env.PORT || 8080

http.createServer(function (req, res) {
  res.setTimeout(25000)
  res.setHeader('Access-Control-Allow-Origin', '*')
  try {
    request(req.url.slice(1), {encoding: null}, function(error, response, body) {
      res.write(body)
      res.end()
    })
  }
  catch(e) {}
}).listen(port)

console.log("Listening on port: " + port)<commit_msg>forward original response status code and headers<commit_after>#!/usr/bin/env node
var http = require('http')
var request = require('request')

var port = process.env.PROXY_PORT || 8080

http.createServer(function (req, res) {
  res.setTimeout(25000)
  try {
    var url = req.url.slice(1)
    console.log('GET '+url);
    request(url, {encoding: null}, function(error, response, body) {
      response.headers['Access-Control-Allow-Origin'] = '*'
      res.writeHead(response.statusCode, response.headers)
      res.write(body)
      res.end()
    })
  }
  catch(e) {
    console.log('GET '+url+' failed\n\t'+e)
  }
}).listen(port)

console.log("Listening on port: " + port)
{'fraction_non_alphanumeric': 0.17088055797733218, 'fraction_numerical': 0.017436791630340016, 'mean_word_length': 3.803347280334728, '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': '4340276', 'n_tokens_mistral': 410, 'n_tokens_neox': 392, 'n_words': 79}