<commit_before># node-tunnel - HTTP/HTTPS Agents for tunneling proxies

## Example

    var tunnel = require('tunnel');

    var myAgent = tunnel.httpsOverHttp({
      proxy: {
        host: 'localhost',
        port: 3128
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });

## Installation

    $ npm install tunnel

## Usages

### HTTP over HTTP tunneling

    var agent = tunnel.httpOverHttp({
      maxSockets: poolSize, // Defaults to 5

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 80

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        }
      }
    });

    var req = http.request({
      host: 'example.com',
      port: 80,
      agent: myAgent
    });

### HTTPS over HTTP tunneling

    var agent = tunnel.httpsOverHttp({
      maxSockets: poolSize, // Defaults to 5

      // CA for origin server if necessary
      ca: [ fs.readFileSync('origin-server-ca.pem')],

      // Client certification for origin server if necessary
      key: fs.readFileSync('origin-server-key.pem'),
      cert: fs.readFileSync('origin-server-cert.pem'),

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 80

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        },
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });

### HTTP over HTTPS tunneling

    var agent = tunnel.httpOverHttps({
      maxSockets: poolSize, // Defaults to 5

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 443

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        },

        // CA for proxy server if necessary
        ca: [ fs.readFileSync('origin-server-ca.pem')],

        // Client certification for proxy server if necessary
        key: fs.readFileSync('origin-server-key.pem'),
        cert: fs.readFileSync('origin-server-cert.pem'),
      }
    });

    var req = http.request({
      host: 'example.com',
      port: 80,
      agent: myAgent
    });

### HTTPS over HTTPS tunneling

    var agent = tunnel.httpsOverHttps({
      maxSockets: poolSize, // Defaults to 5

      // CA for origin server if necessary
      ca: [ fs.readFileSync('origin-server-ca.pem')],

      // Client certification for origin server if necessary
      key: fs.readFileSync('origin-server-key.pem'),
      cert: fs.readFileSync('origin-server-cert.pem'),

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 443

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        }

        // CA for proxy server if necessary
        ca: [ fs.readFileSync('origin-server-ca.pem')],

        // Client certification for proxy server if necessary
        key: fs.readFileSync('origin-server-key.pem'),
        cert: fs.readFileSync('origin-server-cert.pem'),
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });
<commit_msg>Fix usage<commit_after># node-tunnel - HTTP/HTTPS Agents for tunneling proxies

## Example

    var tunnel = require('tunnel');

    var myAgent = tunnel.httpsOverHttp({
      proxy: {
        host: 'localhost',
        port: 3128
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });

## Installation

    $ npm install tunnel

## Usages

### HTTP over HTTP tunneling

    var myAgent = tunnel.httpOverHttp({
      maxSockets: poolSize, // Defaults to 5

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 80

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        }
      }
    });

    var req = http.request({
      host: 'example.com',
      port: 80,
      agent: myAgent
    });

### HTTPS over HTTP tunneling

    var myAgent = tunnel.httpsOverHttp({
      maxSockets: poolSize, // Defaults to 5

      // CA for origin server if necessary
      ca: [ fs.readFileSync('origin-server-ca.pem')],

      // Client certification for origin server if necessary
      key: fs.readFileSync('origin-server-key.pem'),
      cert: fs.readFileSync('origin-server-cert.pem'),

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 80

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>:password',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        },
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });

### HTTP over HTTPS tunneling

    var myAgent = tunnel.httpOverHttps({
      maxSockets: poolSize, // Defaults to 5

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 443

        // Basic authorization for proxy server if necessary
        proxyAuth: 'user:password',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        },

        // CA for proxy server if necessary
        ca: [ fs.readFileSync('origin-server-ca.pem')],

        // Client certification for proxy server if necessary
        key: fs.readFileSync('origin-server-key.pem'),
        cert: fs.readFileSync('origin-server-cert.pem'),
      }
    });

    var req = http.request({
      host: 'example.com',
      port: 80,
      agent: myAgent
    });

### HTTPS over HTTPS tunneling

    var myAgent = tunnel.httpsOverHttps({
      maxSockets: poolSize, // Defaults to 5

      // CA for origin server if necessary
      ca: [ fs.readFileSync('origin-server-ca.pem')],

      // Client certification for origin server if necessary
      key: fs.readFileSync('origin-server-key.pem'),
      cert: fs.readFileSync('origin-server-cert.pem'),

      proxy: { // Proxy settings
        host: proxyHost, // Defaults to 'localhost'
        port: proxyPort, // Defaults to 443

        // Basic authorization for proxy server if necessary
        proxyAuth: '<PASSWORD>',

        // Header fields for proxy server if necessary
        headers: {
          'User-Agent': 'Node'
        }

        // CA for proxy server if necessary
        ca: [ fs.readFileSync('origin-server-ca.pem')],

        // Client certification for proxy server if necessary
        key: fs.readFileSync('origin-server-key.pem'),
        cert: fs.readFileSync('origin-server-cert.pem'),
      }
    });

    var req = https.request({
      host: 'example.com',
      port: 443,
      agent: myAgent
    });

{'fraction_non_alphanumeric': 0.11761617222368076, 'fraction_numerical': 0.008138619060120767, 'mean_word_length': 2.02101506740682, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '5022678', 'n_tokens_mistral': 2267, 'n_tokens_neox': 2124, 'n_words': 643}