Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-proxy

Package Overview
Dependencies
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxy - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

4

CHANGELOG.md
## ChangeLog for: node-http-proxy
## Version 0.9.1 - 3/9/2012
- Ensure that `webSocketProxyError` and `proxyError` both receive the error (indexzero).
## Version 0.9.0 - 3/9/2012

@@ -4,0 +8,0 @@ - Fix #276 Ensure response.headers.location is defined (indexzero)

@@ -26,2 +26,7 @@ var path = require('path');

for (var i = 0; i < exts.length; i++) {
if (process.env.DEBUG_MIME && this.types[exts]) {
console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
this.types[exts] + ' to ' + type);
}
this.types[exts[i]] = type;

@@ -46,2 +51,4 @@ }

Mime.prototype.load = function(file) {
this._loading = file;
// Read file and split into lines

@@ -59,2 +66,4 @@ var map = {},

this.define(map);
this._loading = null;
};

@@ -105,4 +114,4 @@

}
}
};
module.exports = mime;

28

examples/node_modules/connect-gzip/node_modules/mime/package.json
{
"author": {
"name": "Robert Kieffer",
"url": "http://github.com/broofa",
"email": "robert@broofa.com"
"email": "robert@broofa.com",
"url": "http://github.com/broofa"
},

@@ -10,4 +10,4 @@ "contributors": [

"name": "Benjamin Thomas",
"url": "http://github.com/bentomas",
"email": "benjamin@benjaminthomas.org"
"email": "benjamin@benjaminthomas.org",
"url": "http://github.com/bentomas"
}

@@ -18,7 +18,21 @@ ],

"devDependencies": {},
"keywords": ["util", "mime"],
"keywords": [
"util",
"mime"
],
"main": "mime.js",
"name": "mime",
"repository": {"url": "https://github.com/broofa/node-mime", "type": "git"},
"version": "1.2.7"
"repository": {
"url": "https://github.com/broofa/node-mime",
"type": "git"
},
"version": "1.2.9",
"readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n",
"readmeFilename": "README.md",
"_id": "mime@1.2.9",
"dist": {
"shasum": "5e8dffc8439b537862ae11038877be1bcca75d40"
},
"_from": "mime@>= 0.0.1",
"_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.9.tgz"
}

@@ -5,3 +5,5 @@ {

"version": "0.1.6",
"author": "Nate Smith",
"author": {
"name": "Nate Smith"
},
"main": "./index.js",

@@ -19,3 +21,11 @@ "dependencies": {

},
"optionalDependencies": {}
}
"optionalDependencies": {},
"readme": "# connect-gzip\n\nGzip middleware for [Connect](http://senchalabs.github.com/connect/) on [Node.js](http://nodejs.org). Uses Unix [`gzip`](http://www.freebsd.org/cgi/man.cgi?query=gzip) command to perform compression of dynamic requests or static files. Originally based on implementation included with Connect before version 1.0.\n\n\n## Installation\n\nInstall via npm:\n\n $ npm install connect-gzip\n\n\n## Usage\n\n### gzip.gzip([options])\n\nInclude this middleware to dynamically gzip data sent via `res.write` or `res.end` based on the Content-Type header.\n\n var connect = require('connect'),\n gzip = require('connect-gzip');\n \n connect.createServer(\n gzip.gzip(),\n function(req, res) {\n res.setHeader('Content-Type', 'text/html');\n res.end('<p>Some gzipped HTML!</p>');\n }\n ).listen(3000);\n \n \n // Only gzip css files:\n gzip.gzip({ matchType: /css/ })\n \n // Use maximum compression:\n gzip.gzip({ flags: '--best' })\n\nOptions:\n\n- `matchType` - A regular expression tested against the Content-Type header to determine whether the response should be gzipped or not. The default value is `/text|javascript|json/`.\n- `bin` - Command executed to perform gzipping. Defaults to `'gzip'`.\n- `flags` - Command flags passed to the gzip binary. Nothing by default for dynamic gzipping, so gzip will typically default to a compression level of 6.\n\n\n### gzip.staticGzip(root, [options])\n\nGzips files in a root directory, and then serves them using the default [`connect.static`](http://senchalabs.github.com/connect/middleware-static.html) middleware. Note that options get passed through as well, so the `maxAge` and other options supported by `connect.static` also work.\n\nIf a file under the root path (such as an image) does not have an appropriate MIME type for compression, it will still be passed through to `connect.static` and served uncompressed. Thus, you can simply use `gzip.staticGzip` in place of `connect.static`.\n\n var connect = require('connect'),\n gzip = require('connect-gzip');\n \n connect.createServer(\n gzip.staticGzip(__dirname + '/public')\n ).listen(3000);\n \n \n // Only gzip javascript files:\n gzip.staticGzip(__dirname + '/public', { matchType: /javascript/ })\n\n // Set a maxAge in milliseconds for browsers to cache files\n var oneDay = 86400000;\n gzip.staticGzip(__dirname + '/public', { maxAge: oneDay })\n\nOptions:\n\n- `matchType` - A regular expression tested against the file MIME type to determine whether the response should be gzipped or not. As in `connect.static`, MIME types are determined based on file extensions using [node-mime](https://github.com/bentomas/node-mime). The default value is `/text|javascript|json/`.\n- `bin` - Command executed to perform gzipping. Defaults to `'gzip'`.\n- `flags` - Command flags passed to the gzip binary. Defaults to `'--best'` for staticGzip.\n\n\n## Tests\n\nRun the tests with\n\n expresso test\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 Nate Smith &lt;nate@nateps.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "README.md",
"_id": "connect-gzip@0.1.6",
"dist": {
"shasum": "10d98fb74c8421d9ea0f5deaeaefb8e59c3c23fd"
},
"_from": "connect-gzip@0.1",
"_resolved": "https://registry.npmjs.org/connect-gzip/-/connect-gzip-0.1.6.tgz"
}
{
"name" : "connect-jsonp",
"version" : "0.0.5",
"description" : "jsonp middleware for connect",
"keywords" : ["jsonp", "connect", "middleware", "nodejs"],
"homepage" : "https://github.com/steelThread/connect-jsonp",
"author" : "Sean McDaniel <sean.mcdaniel@me.com>",
"main" : "index",
"repository" : {"type": "git", "url": "https://steelThread@github.com/steelThread/connect-jsonp.git" },
"dependencies" : {"connect" : ">= 1.0.0"},
"engines" : {"node" : ">= 0.4.1 < 0.5.0"}
}
"name": "connect-jsonp",
"version": "0.0.5",
"description": "jsonp middleware for connect",
"keywords": [
"jsonp",
"connect",
"middleware",
"nodejs"
],
"homepage": "https://github.com/steelThread/connect-jsonp",
"author": {
"name": "Sean McDaniel",
"email": "sean.mcdaniel@me.com"
},
"main": "index",
"repository": {
"type": "git",
"url": "https://steelThread@github.com/steelThread/connect-jsonp.git"
},
"dependencies": {
"connect": ">= 1.0.0"
},
"engines": {
"node": ">= 0.4.1 < 0.5.0"
},
"readme": "# connect jsonp\n\n## Installation\n\n $ npm install connect-jsonp\n\n## Config\n\nIn order to facilitate caching as well as avoid downstream middleware conflicts the filter config option\nexists and instructs this module to filter (or not) the callback param from the request url. This defaults \nto false but can be specified passing either a boolean or the literal {filter: true} to your requires statement. \nIn is important to note that you will want to filter the callback param if you are planning on using the \nconnect cache middleware. Furthermore you will also want to ensure that the cache module is after this module \nas the url, including the query string, is used as a key into the cache (thanks to <a href=\"https://github.com/jmarca\">jmarca</a> \nfor pointing this out).\n\n## Testing\n\n git submodule update --init\n make test\n\n## TODOs\n\nCurrent this middleware proxies the res.writeHead method. This is limiting and will will potentially raise exceptions \nfor apps that simply call end. \n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 Sean McDaniel\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "README.md",
"_id": "connect-jsonp@0.0.5",
"dist": {
"shasum": "3339dde74e3eade7d3e8d059c9225a227fd1675e"
},
"_from": "connect-jsonp@0.0.5",
"_resolved": "https://registry.npmjs.org/connect-jsonp/-/connect-jsonp-0.0.5.tgz"
}

@@ -1,8 +0,23 @@

{ "name": "connect-restreamer"
, "version": "1.0.0"
, "description": "re-stream a parsed body so that it can be proxied."
, "homepage": "http://github.com/dominictarr/connect-restreamer"
, "repository":
{ "type": "git"
, "url": "https://github.com/dominictarr/connect-restreamer.git" }
, "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://bit.ly/dominictarr)" }
{
"name": "connect-restreamer",
"version": "1.0.0",
"description": "re-stream a parsed body so that it can be proxied.",
"homepage": "http://github.com/dominictarr/connect-restreamer",
"repository": {
"type": "git",
"url": "https://github.com/dominictarr/connect-restreamer.git"
},
"author": {
"name": "Dominic Tarr",
"email": "dominic.tarr@gmail.com",
"url": "http://bit.ly/dominictarr"
},
"readme": "#connect-restreamer\n\nconnect's bodyParser has a problem when using it with a proxy. It gobbles up all the\nbody events, so that the proxy doesn't see anything!\n\n`connect-restreamer` comes to the rescue by re-emitting the body to the proxy.\n\nit has defaults that make it suitable for use with connect's `bodyParser` but can be customized.\n\n## usage\n\njust include `connect-restreamer` in you're middleware chain after the bodyParser\n\n var bodyParser = require('connect/lib/middleware/bodyParser')\n , restreamer = require('connect-restreamer')\n\n //don't worry about incoming contont type\n //bodyParser.parse[''] = JSON.parse\n\n require('http-proxy').createServer(\n //refactor the body parser and re-streamer into a separate package\n bodyParser(),\n //body parser absorbs the data and end events before passing control to the next\n // middleware. if we want to proxy it, we'll need to re-emit these events after \n //passing control to the middleware.\n require('connect-restreamer')(),\n function (req,res, proxy) {\n //custom proxy logic\n //... see https://github.com/nodejitsu/node-http-proxy\n }\n ).listen(80)\n\n\n## customization\n\nrestreamer takes 3 options:\n\n var options = {\n modify: function(body) {\n //a function that may modify the buffered property\n return body\n },\n property: 'body', //name of the buffered property\n stringify:JSON.stringify //function to turn the buffered object back into a string\n }\n\n require('connect-restreamer')(options)\n",
"readmeFilename": "readme.markdown",
"_id": "connect-restreamer@1.0.0",
"dist": {
"shasum": "4ef5f5ba2f86ed3ee39a7dabdabb6b56469d05c2"
},
"_from": "connect-restreamer@1",
"_resolved": "https://registry.npmjs.org/connect-restreamer/-/connect-restreamer-1.0.0.tgz"
}

@@ -5,6 +5,18 @@ {

"description": "High performance middleware framework",
"keywords": ["framework", "web", "middleware", "connect", "rack"],
"repository": "git://github.com/senchalabs/connect.git",
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
"repository": "git://github.com/senchalabs/connect",
"keywords": [
"framework",
"web",
"middleware",
"connect",
"rack"
],
"repository": {
"type": "git",
"url": "git://github.com/senchalabs/connect"
},
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca",
"url": "http://tjholowaychuk.com"
},
"dependencies": {

@@ -24,3 +36,12 @@ "qs": ">= 0.3.1",

"main": "index",
"engines": { "node": ">= 0.4.1 < 0.5.0" }
}
"engines": {
"node": ">= 0.4.1 < 0.5.0"
},
"_id": "connect@1.6.4",
"readme": "ERROR: No README.md file found!",
"dist": {
"shasum": "74b5f632d98e58d25d06d5eee537dcf03cfbdde4"
},
"_from": "connect@1.6",
"_resolved": "https://registry.npmjs.org/connect/-/connect-1.6.4.tgz"
}

@@ -8,6 +8,6 @@ //

function matcher (url, dest) {
// First, turn the URL into a regex.
// First, turn the URL into a regex.
// NOTE: Turning user input directly into a Regular Expression is NOT SAFE.
var r = new RegExp(url.replace(/\//, '\\/'));
// This next block of code may look a little confusing.
// This next block of code may look a little confusing.
// It returns a closure (anonymous function) for each URL to be matched,

@@ -17,3 +17,3 @@ // storing them in an array - on each request, if the URL matches one that has

return function (url) {
var m = r(url)
var m = r.exec(url);
if (!m) {

@@ -20,0 +20,0 @@ return;

@@ -1,11 +0,28 @@

{ "name": "proxy-by-url"
, "version": "0.0.1"
, "description": "custom logic for node-http-proxy to proxy basedon incoming url"
, "homepage": "http://github.com/dominictarr/proxy-by-url"
, "repository":
{ "type": "git"
, "url": "https://github.com/dominictarr/proxy-by-url.git" }
, "dependencies": {}
, "devDependencies": {}
, "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://bit.ly/dominictarr)"
, "scripts": { "test": "meta-test test/*.js" } }
{
"name": "proxy-by-url",
"version": "0.0.2",
"description": "custom logic for node-http-proxy to proxy basedon incoming url",
"homepage": "http://github.com/dominictarr/proxy-by-url",
"repository": {
"type": "git",
"url": "https://github.com/dominictarr/proxy-by-url.git"
},
"dependencies": {},
"devDependencies": {},
"author": {
"name": "Dominic Tarr",
"email": "dominic.tarr@gmail.com",
"url": "http://bit.ly/dominictarr"
},
"scripts": {
"test": "meta-test test/*.js"
},
"readme": "#proxy by url\n\nthis is a simple example of a node-http-middleware that will proxy based on the incoming url.\nsay you want to proxy every request thing under /database to localhost:5984 (couchbd)\n(and remove the /database prefix)\n\nthis is how:\n\n require('http-proxy').createServer(\n require('proxy-by-url')({\n '/database': { port: 5984, host: 'localhost' },\n })\n ).listen(8000)\n",
"readmeFilename": "readme.markdown",
"_id": "proxy-by-url@0.0.2",
"dist": {
"shasum": "976433200dfcf5772f239c9689e003331469dc44"
},
"_from": "proxy-by-url@>= 0.0.1",
"_resolved": "https://registry.npmjs.org/proxy-by-url/-/proxy-by-url-0.0.2.tgz"
}

@@ -683,3 +683,3 @@ /*

self.emit('webSocketProxyError', req, socket, head);
self.emit('webSocketProxyError', err, req, socket, head);
}

@@ -686,0 +686,0 @@

{
"name": "http-proxy",
"version": "0.9.0",
"version": "0.9.1",
"description": "A full-featured http reverse proxy for node.js",

@@ -5,0 +5,0 @@ "author": "Nodejitsu Inc. <info@nodejitsu.com>",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc