summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks')
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore4
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE20
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md339
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js33
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js30
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js31
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js6
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js108
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js306
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc46
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore2
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml15
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md90
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js416
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json57
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js407
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore5
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml11
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE20
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md307
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js726
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map1
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js371
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json73
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js410
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts383
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json72
27 files changed, 4289 insertions, 0 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore
new file mode 100644
index 0000000000..7deddced8b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore
@@ -0,0 +1,4 @@
+node_modules
+.git*
+.idea
+npm-debug.log \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE
new file mode 100644
index 0000000000..b2442a9e71
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Josh Glazebrook
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md
new file mode 100644
index 0000000000..890b7deb6a
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md
@@ -0,0 +1,339 @@
+socks
+=============
+
+socks is a full client implementation of the SOCKS 4, 4a, and 5 protocols in an easy to use node.js module.
+
+### Notice
+As of February 26th, 2015, socks is the new home of the socks-client package.
+
+### Why socks?
+
+There is not any other SOCKS proxy client library on npm that supports all three variants of the SOCKS protocol. Nor are there any that support the BIND and associate features that some versions of the SOCKS protocol supports.
+
+Key Features:
+* Supports SOCKS 4, 4a, and 5 protocols
+* Supports the connect method (simple tcp connections of SOCKS) (Client -> SOCKS Server -> Target Server)
+* Supports the BIND method (4, 4a, 5)
+* Supports the associate (UDP forwarding) method (5)
+* Simple and easy to use (one function call to make any type of SOCKS connection)
+
+## Installing:
+
+`npm install socks`
+
+### Getting Started Example
+
+For this example, say you wanted to grab the html of google's home page.
+
+```javascript
+var Socks = require('socks');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108", // Random public proxy
+ port: 1080,
+ type: 5 // type is REQUIRED. Valid types: [4, 5] (note 4 also works for 4a)
+ },
+ target: {
+ host: "google.com", // can be an ip address or domain (4a and 5 only)
+ port: 80
+ },
+ command: 'connect' // This defaults to connect, so it's optional if you're not using BIND or Associate.
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // Connection has been established, we can start sending data now:
+ socket.write("GET / HTTP/1.1\nHost: google.com\n\n");
+ socket.on('data', function(data) {
+ console.log(data.length);
+ console.log(data);
+ });
+
+ // PLEASE NOTE: sockets need to be resumed before any data will come in or out as they are paused right before this callback is fired.
+ socket.resume();
+
+ // 569
+ // <Buffer 48 54 54 50 2f 31 2e 31 20 33 30 31 20 4d 6f 76 65 64 20 50 65...
+ }
+});
+```
+
+### BIND Example:
+
+When sending the BIND command to a SOCKS proxy server, this will cause the proxy server to open up a new tcp port. Once this port is open, you, another client, application, etc, can then connect to the SOCKS proxy on that tcp port and communications will be forwarded to each connection through the proxy itself.
+
+```javascript
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 4,
+ command: "bind" // Since we are using bind, we must specify it here.
+ },
+ target: {
+ host: "1.2.3.4", // When using bind, it's best to give an estimation of the ip that will be connecting to the newly opened tcp port on the proxy server.
+ port: 1080
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // BIND request has completed.
+ // info object contains the remote ip and newly opened tcp port to connect to.
+ console.log(info);
+
+ // { port: 1494, host: '202.101.228.108' }
+
+ socket.on('data', function(data) {
+ console.log(data.length);
+ console.log(data);
+ });
+
+ // Remember to resume the socket stream.
+ socket.resume();
+ }
+});
+
+```
+At this point, your original connection to the proxy server remains open, and no data will be received until a tcp connection is made to the given endpoint in the info object.
+
+For an example, I am going to connect to the endpoint with telnet:
+
+```
+Joshs-MacBook-Pro:~ Josh$ telnet 202.101.228.108 1494
+ Trying 202.101.228.108...
+ Connected to 202.101.228.108.
+ Escape character is '^]'.
+ hello
+ aaaaaaaaa
+```
+
+Note that this connection to the newly bound port does not need to go through the SOCKS handshake.
+
+Back at our original connection we see that we have received some new data:
+
+```
+8
+<Buffer 00 5a ca 61 43 a8 09 01> // This first piece of information can be ignored.
+
+7
+<Buffer 68 65 6c 6c 6f 0d 0a> // Hello <\r\n (enter key)>
+
+11
+<Buffer 61 61 61 61 61 61 61 61 61 0d 0a> // aaaaaaaaa <\r\n (enter key)>
+```
+
+As you can see the data entered in the telnet terminal is routed through the SOCKS proxy and back to the original connection that was made to the proxy.
+
+**Note** Please pay close attention to the first piece of data that was received.
+
+```
+<Buffer 00 5a ca 61 43 a8 09 01>
+
+ [005a] [PORT:2} [IP:4]
+```
+
+This piece of data is technically part of the SOCKS BIND specifications, but because of my design decisions that were made in an effort to keep this library simple to use, you will need to make sure to ignore and/or deal with this initial packet that is received when a connection is made to the newly opened port.
+
+### Associate Example:
+The associate command sets up a UDP relay for the remote SOCKS proxy server to relay UDP packets to the remote host of your choice.
+
+```javascript
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: "associate" // Since we are using associate, we must specify it here.
+ },
+ target: {
+ // When using associate, either set the ip and port to 0.0.0.0:0 or the expected source of incoming udp packets.
+ // Note: Some SOCKS servers MAY block associate requests with 0.0.0.0:0 endpoints.
+ // Note: ipv4, ipv6, and hostnames are supported here.
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // Associate request has completed.
+ // info object contains the remote ip and udp port to send UDP packets to.
+ console.log(info);
+ // { port: 42803, host: '202.101.228.108' }
+
+ var udp = new dgram.Socket('udp4');
+
+ // In this example we are going to send "Hello" to 1.2.3.4:2323 through the SOCKS proxy.
+
+ var pack = Socks.createUDPFrame({ host: "1.2.3.4", port: 2323}, new Buffer("hello"));
+
+ // Send Packet to Proxy UDP endpoint given in the info object.
+ udp.send(pack, 0, pack.length, info.port, info.host);
+ }
+});
+
+```
+Now assuming that the associate request went through correctly. Anything that is typed in the stdin will first be sent to the SOCKS proxy on the endpoint that was provided in the info object. Once the SOCKS proxy receives it, it will then forward on the actual UDP packet to the host you you wanted.
+
+
+1.2.3.4:2323 should now receive our relayed UDP packet from 202.101.228.108 (SOCKS proxy)
+```
+// <Buffer 68 65 6c 6c 6f>
+```
+
+## Using socks as an HTTP Agent
+
+You can use socks as a http agent which will relay all your http
+connections through the socks server.
+
+The object that `Socks.Agent` accepts is the same as `Socks.createConnection`, you don't need to set a target since you have to define it in `http.request` or `http.get` methods.
+
+The second argument is a boolean which indicates whether the remote endpoint requires TLS.
+
+```javascript
+var socksAgent = new Socks.Agent({
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ }},
+ true, // we are connecting to a HTTPS server, false for HTTP server
+ false // rejectUnauthorized option passed to tls.connect(). Only when secure is set to true
+);
+
+http.get({ hostname: 'google.com', port: '443', agent: socksAgent}, function (res) {
+ // Connection header by default is keep-alive, we have to manually end the socket
+ socksAgent.encryptedSocket.end();
+});
+```
+
+# Api Reference:
+
+There are only three exported functions that you will ever need to use.
+
+### Socks.createConnection( options, callback(err, socket, info) )
+> `Object` **Object containing options to use when creating this connection**
+
+> `function` **Callback that is called when connection completes or errors**
+
+Options:
+
+```javascript
+var options = {
+
+ // Information about proxy server
+ proxy: {
+ // IP Address of Proxy (Required)
+ ipaddress: "1.2.3.4",
+
+ // TCP Port of Proxy (Required)
+ port: 1080,
+
+ // Proxy Type [4, 5] (Required)
+ // Note: 4 works for both 4 and 4a.
+ type: 4,
+
+ // SOCKS Connection Type (Optional)
+ // - defaults to 'connect'
+
+ // 'connect' - establishes a regular SOCKS connection to the target host.
+ // 'bind' - establishes an open tcp port on the SOCKS for another client to connect to.
+ // 'associate' - establishes a udp association relay on the SOCKS server.
+ command: "connect",
+
+
+ // SOCKS 4 Specific:
+
+ // UserId used when making a SOCKS 4/4a request. (Optional)
+ userid: "someuserid",
+
+ // SOCKS 5 Specific:
+
+ // Authentication used for SOCKS 5 (when it's required) (Optional)
+ authentication: {
+ username: "Josh",
+ password: "somepassword"
+ }
+ },
+
+ // Information about target host and/or expected client of a bind association. (Required)
+ target: {
+ // When using 'connect': IP Address or hostname (4a and 5 only) of a target to connect to.
+ // When using 'bind': IP Address of the expected client that will connect to the newly open tcp port.
+ // When using 'associate': IP Address and Port of the expected client that will send UDP packets to this UDP association relay.
+
+ // Note:
+ // When using SOCKS 4, only an ipv4 address can be used.
+ // When using SOCKS 4a, an ipv4 address OR a hostname can be used.
+ // When using SOCKS 5, ipv4, ipv6, or a hostname can be used.
+ host: "1.2.3.4",
+
+ // TCP port of target to connect to.
+ port: 1080
+ },
+
+ // Amount of time to wait for a connection to be established. (Optional)
+ // - defaults to 10000ms (10 seconds)
+ timeout: 10000
+};
+```
+Callback:
+
+```javascript
+
+// err: If an error occurs, err will be an Error object, otherwise null.
+// socket: Socket with established connection to your target host.
+// info: If using BIND or associate, this will be the remote endpoint to use.
+
+function(err, socket, info) {
+ // Hopefully no errors :-)
+}
+```
+
+### Socks.createUDPFrame( target, data, [frame] )
+> `Object` **Target host object containing destination for UDP packet**
+
+> `Buffer` **Data Buffer to send in the UDP packet**
+
+> `Number` **Frame number in UDP packet. (defaults to 0)**
+
+Creates a UDP packet frame for using with UDP association relays.
+
+returns `Buffer` The completed UDP packet container to be sent to the proxy for forwarding.
+
+target:
+```javascript
+
+// Target host information for where the UDP packet should be sent.
+var target =
+ {
+ // ipv4, ipv6, or hostname for where to have the proxy send the UDP packet.
+ host: "1.2.3.4",
+
+ // udpport for where to send the UDP packet.
+ port: 2323
+ }
+
+```
+
+### Socks.Agent( options, tls) )
+> `Object` **Object containing options to use when creating this connection (see above in createConnection)**
+
+> `boolean` **Boolean indicating if we upgrade the connection to TLS on the socks server**
+
+
+# Further Reading:
+Please read the SOCKS 5 specifications for more information on how to use BIND and Associate.
+http://www.ietf.org/rfc/rfc1928.txt
+
+# License
+This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License).
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js
new file mode 100644
index 0000000000..82d6afa97b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js
@@ -0,0 +1,33 @@
+var Socks = require('../index.js');
+var dgram = require('dgram');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: 'associate'
+ },
+
+ target: {
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ // Associate request completed.
+ // Now we can send properly formed UDP packet frames to this endpoint for forwarding:
+ console.log(info);
+ // { port: 4381, host: '202.101.228.108' }
+
+ var udp = new dgram.Socket('udp4');
+ var packet = SocksClient.createUDPFrame({ host: "1.2.3.4", port: 5454}, new Buffer("Hello"));
+ udp.send(packet, 0, packet.length, info.port, info.host);
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js
new file mode 100644
index 0000000000..4410dd1def
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js
@@ -0,0 +1,30 @@
+var Socks = require('../index.js');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: 'bind'
+ },
+
+ target: {
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ // BIND request completed, now a tcp client should connect to this endpoint:
+ console.log(info);
+ // { port: 3334, host: '202.101.228.108' }
+
+ // Resume! You need to!
+ socket.resume();
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js
new file mode 100644
index 0000000000..528ad4d416
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js
@@ -0,0 +1,31 @@
+var Socks = require('../index.js');
+
+var options = {
+ proxy: {
+ ipaddress: "31.193.133.9",
+ port: 1081,
+ type: 5 // (4 or 5)
+ },
+
+ target: {
+ host: "173.194.33.103", // (google.com)
+ port: 80
+ }
+};
+
+Socks.createConnection(options, function (err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ socket.on('data', function (data) {
+ // do something with incoming data
+ });
+
+ // Please remember that sockets need to be resumed before any data will come in.
+ socket.resume();
+
+ // We can do whatever we want with the socket now.
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js
new file mode 100644
index 0000000000..29331d4a1c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js
@@ -0,0 +1,6 @@
+var SocksClient = require('./lib/socks-client.js');
+var SocksAgent = require('./lib/socks-agent.js');
+
+exports.createConnection = SocksClient.createConnection;
+exports.createUDPFrame = SocksClient.createUDPFrame;
+exports.Agent = SocksAgent.Agent;
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js
new file mode 100644
index 0000000000..db1c301ec9
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js
@@ -0,0 +1,108 @@
+var tls = require('tls');
+var inherits = require('util').inherits;
+var EventEmitter = require('events').EventEmitter;
+var SocksClient = require('./socks-client.js');
+
+function SocksAgent(options, secure, rejectUnauthorized) {
+ this.options = options;
+ this.secure = secure || false;
+ this.rejectUnauthorized = rejectUnauthorized;
+
+ if (this.rejectUnauthorized === undefined) {
+ this.rejectUnauthorized = true;
+ }
+}
+
+inherits(SocksAgent, EventEmitter);
+
+SocksAgent.prototype.createConnection = function(req, opts, fn) {
+ var handler = fn, host, self = this;
+
+ this.options.target = this.options.target || {};
+
+ if (!this.options.target.host) {
+ this.options.target.host = opts.host;
+ }
+
+ if (!this.options.target.port) {
+ this.options.target.port = opts.port;
+ }
+
+ host = this.options.target.host;
+
+ if (this.secure) {
+ handler = function(err, socket, info) {
+ var options, cleartext;
+
+ if (err) {
+ return fn(err);
+ }
+
+ // save encrypted socket
+ self.encryptedSocket = socket;
+
+ options = {
+ socket: socket,
+ servername: host,
+ rejectUnauthorized: self.rejectUnauthorized
+ };
+
+ cleartext = tls.connect(options, function (err) {
+ return fn(err, this);
+ });
+ cleartext.on('error', fn);
+
+ socket.resume();
+ }
+ }
+
+ SocksClient.createConnection(this.options, handler);
+};
+
+/**
+ * @see https://www.npmjs.com/package/agent-base
+ */
+SocksAgent.prototype.addRequest = function(req, host, port, localAddress) {
+ var opts;
+ if ('object' === typeof host) {
+ // >= v0.11.x API
+ opts = host;
+ if (opts.host && opts.path) {
+ // if both a `host` and `path` are specified then it's most likely the
+ // result of a `url.parse()` call... we need to remove the `path` portion so
+ // that `net.connect()` doesn't attempt to open that as a unix socket file.
+ delete opts.path;
+ }
+ } else {
+ // <= v0.10.x API
+ opts = { host: host, port: port };
+ if (null !== localAddress) {
+ opts.localAddress = localAddress;
+ }
+ }
+
+ var sync = true;
+
+ this.createConnection(req, opts, function (err, socket) {
+ function emitErr () {
+ req.emit('error', err);
+ }
+ if (err) {
+ if (sync) {
+ // need to defer the "error" event, when sync, because by now the `req`
+ // instance hasn't event been passed back to the user yet...
+ process.nextTick(emitErr);
+ } else {
+ emitErr();
+ }
+ } else {
+ req.onSocket(socket);
+ //have to resume this socket when node 12
+ socket.resume();
+ }
+ });
+
+ sync = false;
+};
+
+exports.Agent = SocksAgent;
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js
new file mode 100644
index 0000000000..4a31f62c32
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js
@@ -0,0 +1,306 @@
+var net = require('net');
+var ip = require('ip');
+var SmartBuffer = require('smart-buffer');
+
+(function () {
+
+ var COMMAND = {
+ Connect: 0x01,
+ Bind: 0x02,
+ Associate: 0x03
+ };
+
+ var SOCKS4_RESPONSE = {
+ Granted: 0x5A,
+ Failed: 0x5B,
+ Rejected: 0x5C,
+ RejectedIdent: 0x5D
+ };
+
+ var SOCKS5_AUTH = {
+ NoAuth: 0x00,
+ GSSApi: 0x01,
+ UserPass: 0x02
+ };
+
+ var SOCKS5_RESPONSE = {
+ Granted: 0x00,
+ Failure: 0x01,
+ NotAllowed: 0x02,
+ NetworkUnreachable: 0x03,
+ HostUnreachable: 0x04,
+ ConnectionRefused: 0x05,
+ TTLExpired: 0x06,
+ CommandNotSupported: 0x07,
+ AddressNotSupported: 0x08
+ };
+
+
+ exports.createConnection = function (options, callback) {
+ var socket = new net.Socket(), finished = false, buff = new SmartBuffer();
+
+ // Defaults
+ options.timeout = options.timeout || 10000;
+ options.proxy.command = commandFromString(options.proxy.command);
+ options.proxy.userid = options.proxy.userid || "";
+
+ var auth = options.proxy.authentication || {};
+ auth.username = auth.username || "";
+ auth.password = auth.password || "";
+
+ options.proxy.authentication = auth;
+
+ // Connect & negotiation timeout
+ function onTimeout() {
+ finish(new Error("Connection Timed Out"), socket, null, callback);
+ }
+ socket.setTimeout(options.timeout, onTimeout);
+
+ // Socket events
+ socket.once('close', function () {
+ finish(new Error("Socket Closed"), socket, null, callback);
+ });
+
+ socket.once('error', function (err) {
+ });
+
+ socket.once('connect', function () {
+ if (options.proxy.type === 4) {
+ negotiateSocks4(options, socket, callback);
+ } else if (options.proxy.type === 5) {
+ negotiateSocks5(options, socket, callback);
+ } else {
+ throw new Error("Please specify a proxy type in options.proxy.type");
+ }
+ });
+
+ socket.connect(options.proxy.port, options.proxy.ipaddress);
+
+
+ // 4/4a (connect, bind) - Supports domains & ipaddress
+ function negotiateSocks4(options, socket, callback) {
+ buff.writeUInt8(0x04);
+ buff.writeUInt8(options.proxy.command);
+ buff.writeUInt16BE(options.target.port);
+
+ // ipv4 or domain?
+ if (net.isIPv4(options.target.host)) {
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ buff.writeStringNT(options.proxy.userid);
+ } else {
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x01);
+ buff.writeStringNT(options.proxy.userid);
+ buff.writeStringNT(options.target.host);
+ }
+
+ socket.once('data', receivedResponse);
+ socket.write(buff.toBuffer());
+
+ function receivedResponse(data) {
+ socket.pause();
+ if (data.length === 8 && data[1] === SOCKS4_RESPONSE.Granted) {
+
+ if (options.proxy.command === COMMAND.Bind) {
+ buff.clear();
+ buff.writeBuffer(data);
+ buff.skip(2);
+
+ var info = {
+ port: buff.readUInt16BE(),
+ host: buff.readUInt32BE()
+ };
+
+ if (info.host === 0) {
+ info.host = options.proxy.ipaddress;
+ } else {
+ info.host = ip.fromLong(info.host);
+ }
+
+ finish(null, socket, info, callback);
+ } else {
+ finish(null, socket, null, callback);
+ }
+
+ } else {
+ finish(new Error("Rejected (" + data[1] + ")"), socket, null, callback);
+ }
+ }
+ }
+
+ // Socks 5 (connect, bind, associate) - Supports domains and ipv4, ipv6.
+ function negotiateSocks5(options, socket, callback) {
+ buff.writeUInt8(0x05);
+ buff.writeUInt8(2);
+ buff.writeUInt8(SOCKS5_AUTH.NoAuth);
+ buff.writeUInt8(SOCKS5_AUTH.UserPass);
+
+ socket.once('data', handshake);
+ socket.write(buff.toBuffer());
+
+ function handshake(data) {
+ if (data.length !== 2) {
+ finish(new Error("Negotiation Error"), socket, null, callback);
+ } else if (data[0] !== 0x05) {
+ finish(new Error("Negotiation Error (invalid version)"), socket, null, callback);
+ } else if (data[1] === 0xFF) {
+ finish(new Error("Negotiation Error (unacceptable authentication)"), socket, null, callback);
+ } else {
+ if (data[1] === SOCKS5_AUTH.NoAuth) {
+ sendRequest();
+ } else if (data[1] === SOCKS5_AUTH.UserPass) {
+ sendAuthentication(options.proxy.authentication);
+ } else {
+ finish(new Error("Negotiation Error (unknown authentication type)"), socket, null, callback);
+ }
+ }
+ }
+
+ function sendAuthentication(authinfo) {
+ buff.clear();
+ buff.writeUInt8(0x01);
+ buff.writeUInt8(Buffer.byteLength(authinfo.username));
+ buff.writeString(authinfo.username);
+ buff.writeUInt8(Buffer.byteLength(authinfo.password));
+ buff.writeString(authinfo.password);
+
+ socket.once('data', authenticationResponse);
+ socket.write(buff.toBuffer());
+
+ function authenticationResponse(data) {
+ if (data.length === 2 && data[1] === 0x00) {
+ sendRequest();
+ } else {
+ finish(new Error("Negotiation Error (authentication failed)"), socket, null, callback);
+ }
+ }
+ }
+
+ function sendRequest() {
+ buff.clear();
+ buff.writeUInt8(0x05);
+ buff.writeUInt8(options.proxy.command);
+ buff.writeUInt8(0x00);
+
+ // ipv4, ipv6, domain?
+ if (net.isIPv4(options.target.host)) {
+ buff.writeUInt8(0x01);
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ } else if (net.isIPv6(options.target.host)) {
+ buff.writeUInt8(0x04);
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ } else {
+ buff.writeUInt8(0x03);
+ buff.writeUInt8(options.target.host.length);
+ buff.writeString(options.target.host);
+ }
+ buff.writeUInt16BE(options.target.port);
+
+ socket.once('data', receivedResponse);
+ socket.write(buff.toBuffer());
+ }
+
+ function receivedResponse(data) {
+ socket.pause();
+ if (data.length < 4) {
+ finish(new Error("Negotiation Error"), socket, null, callback);
+ } else if (data[0] === 0x05 && data[1] === SOCKS5_RESPONSE.Granted) {
+ if (options.proxy.command === COMMAND.Connect) {
+ finish(null, socket, null, callback);
+ } else if (options.proxy.command === COMMAND.Bind || options.proxy.command === COMMAND.Associate) {
+ buff.clear();
+ buff.writeBuffer(data);
+ buff.skip(3);
+
+ var info = {};
+ var addrtype = buff.readUInt8();
+
+ try {
+
+ if (addrtype === 0x01) {
+ info.host = buff.readUInt32BE();
+ if (info.host === 0)
+ info.host = options.proxy.ipaddress;
+ else
+ info.host = ip.fromLong(info.host);
+ } else if (addrtype === 0x03) {
+ var len = buff.readUInt8();
+ info.host = buff.readString(len);
+ } else if (addrtype === 0x04) {
+ info.host = buff.readBuffer(16);
+ } else {
+ finish(new Error("Negotiation Error (invalid host address)"), socket, null, callback);
+ }
+ info.port = buff.readUInt16BE();
+
+ finish(null, socket, info, callback);
+ } catch (ex) {
+ finish(new Error("Negotiation Error (missing data)"), socket, null, callback);
+ }
+ }
+ } else {
+ finish(new Error("Negotiation Error (" + data[1] + ")"), socket, null, callback);
+ }
+ }
+ }
+
+ function finish(err, socket, info, callback) {
+ socket.setTimeout(0, onTimeout);
+ if (!finished) {
+ finished = true;
+
+ if (buff instanceof SmartBuffer)
+ buff.destroy();
+
+ if (err && socket instanceof net.Socket) {
+ socket.removeAllListeners('close');
+ socket.removeAllListeners('timeout');
+ socket.removeAllListeners('data');
+ socket.destroy();
+ socket = null;
+ }
+
+ callback(err, socket, info);
+ }
+ }
+
+ function commandFromString(str) {
+ var result = COMMAND.Connect;
+
+ if (str === "connect") {
+ result = COMMAND.Connect;
+ } else if (str === 'associate') {
+ result = COMMAND.Associate;
+ } else if (str === 'bind') {
+ result = COMMAND.Bind;
+ }
+
+ return result;
+ }
+ };
+
+
+ exports.createUDPFrame = function (target, data, frame) {
+ var buff = new SmartBuffer();
+ buff.writeUInt16BE(0);
+ buff.writeUInt8(frame || 0x00);
+
+ if (net.isIPv4(target.host)) {
+ buff.writeUInt8(0x01);
+ buff.writeUInt32BE(ip.toLong(target.host));
+ } else if (net.isIPv6(target.host)) {
+ buff.writeUInt8(0x04);
+ buff.writeBuffer(ip.toBuffer(target.host));
+ } else {
+ buff.writeUInt8(0x03);
+ buff.writeUInt8(Buffer.byteLength(target.host));
+ buff.writeString(target.host);
+ }
+
+ buff.writeUInt16BE(target.port);
+ buff.writeBuffer(data);
+ return buff.toBuffer();
+ };
+})();
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc
new file mode 100644
index 0000000000..dbaae20574
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc
@@ -0,0 +1,46 @@
+{
+ "disallowKeywordsOnNewLine": [ "else" ],
+ "disallowMixedSpacesAndTabs": true,
+ "disallowMultipleLineStrings": true,
+ "disallowMultipleVarDecl": true,
+ "disallowNewlineBeforeBlockStatements": true,
+ "disallowQuotedKeysInObjects": true,
+ "disallowSpaceAfterObjectKeys": true,
+ "disallowSpaceAfterPrefixUnaryOperators": true,
+ "disallowSpaceBeforePostfixUnaryOperators": true,
+ "disallowSpacesInCallExpression": true,
+ "disallowTrailingComma": true,
+ "disallowTrailingWhitespace": true,
+ "disallowYodaConditions": true,
+
+ "requireCommaBeforeLineBreak": true,
+ "requireOperatorBeforeLineBreak": true,
+ "requireSpaceAfterBinaryOperators": true,
+ "requireSpaceAfterKeywords": [ "if", "for", "while", "else", "try", "catch" ],
+ "requireSpaceAfterLineComment": true,
+ "requireSpaceBeforeBinaryOperators": true,
+ "requireSpaceBeforeBlockStatements": true,
+ "requireSpaceBeforeKeywords": [ "else", "catch" ],
+ "requireSpaceBeforeObjectValues": true,
+ "requireSpaceBetweenArguments": true,
+ "requireSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInFunctionDeclaration": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInConditionalExpression": true,
+ "requireSpacesInForStatement": true,
+ "requireSpacesInsideArrayBrackets": "all",
+ "requireSpacesInsideObjectBrackets": "all",
+ "requireDotNotation": true,
+
+ "maximumLineLength": 80,
+ "validateIndentation": 2,
+ "validateLineBreaks": "LF",
+ "validateParameterSeparator": ", ",
+ "validateQuoteMarks": "'"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore
new file mode 100644
index 0000000000..1ca957177f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml
new file mode 100644
index 0000000000..a3a8fad6b6
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml
@@ -0,0 +1,15 @@
+sudo: false
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+ - "4"
+ - "6"
+
+before_install:
+ - travis_retry npm install -g npm@2.14.5
+ - travis_retry npm install
+
+script:
+ - npm test
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md
new file mode 100644
index 0000000000..9035fd71b1
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md
@@ -0,0 +1,90 @@
+# IP
+[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)
+
+IP address utilities for node.js
+
+## Installation
+
+### npm
+```shell
+npm install ip
+```
+
+### git
+
+```shell
+git clone https://github.com/indutny/node-ip.git
+```
+
+## Usage
+Get your ip address, compare ip addresses, validate ip addresses, etc.
+
+```js
+var ip = require('ip');
+
+ip.address() // my ip address
+ip.isEqual('::1', '::0:1'); // true
+ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1])
+ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1
+ip.fromPrefixLen(24) // 255.255.255.0
+ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0
+ip.cidr('192.168.1.134/26') // 192.168.1.128
+ip.not('255.255.255.0') // 0.0.0.255
+ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255
+ip.isPrivate('127.0.0.1') // true
+ip.isV4Format('127.0.0.1'); // true
+ip.isV6Format('::ffff:127.0.0.1'); // true
+
+// operate on buffers in-place
+var buf = new Buffer(128);
+var offset = 64;
+ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64
+ip.toString(buf, offset, 4); // '127.0.0.1'
+
+// subnet information
+ip.subnet('192.168.1.134', '255.255.255.192')
+// { networkAddress: '192.168.1.128',
+// firstAddress: '192.168.1.129',
+// lastAddress: '192.168.1.190',
+// broadcastAddress: '192.168.1.191',
+// subnetMask: '255.255.255.192',
+// subnetMaskLength: 26,
+// numHosts: 62,
+// length: 64,
+// contains: function(addr){...} }
+ip.cidrSubnet('192.168.1.134/26')
+// Same as previous.
+
+// range checking
+ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true
+
+
+// ipv4 long conversion
+ip.toLong('127.0.0.1'); // 2130706433
+ip.fromLong(2130706433); // '127.0.0.1'
+```
+
+### License
+
+This software is licensed under the MIT License.
+
+Copyright Fedor Indutny, 2012.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js
new file mode 100644
index 0000000000..c1799a8c50
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js
@@ -0,0 +1,416 @@
+'use strict';
+
+var ip = exports;
+var Buffer = require('buffer').Buffer;
+var os = require('os');
+
+ip.toBuffer = function(ip, buff, offset) {
+ offset = ~~offset;
+
+ var result;
+
+ if (this.isV4Format(ip)) {
+ result = buff || new Buffer(offset + 4);
+ ip.split(/\./g).map(function(byte) {
+ result[offset++] = parseInt(byte, 10) & 0xff;
+ });
+ } else if (this.isV6Format(ip)) {
+ var sections = ip.split(':', 8);
+
+ var i;
+ for (i = 0; i < sections.length; i++) {
+ var isv4 = this.isV4Format(sections[i]);
+ var v4Buffer;
+
+ if (isv4) {
+ v4Buffer = this.toBuffer(sections[i]);
+ sections[i] = v4Buffer.slice(0, 2).toString('hex');
+ }
+
+ if (v4Buffer && ++i < 8) {
+ sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex'));
+ }
+ }
+
+ if (sections[0] === '') {
+ while (sections.length < 8) sections.unshift('0');
+ } else if (sections[sections.length - 1] === '') {
+ while (sections.length < 8) sections.push('0');
+ } else if (sections.length < 8) {
+ for (i = 0; i < sections.length && sections[i] !== ''; i++);
+ var argv = [ i, 1 ];
+ for (i = 9 - sections.length; i > 0; i--) {
+ argv.push('0');
+ }
+ sections.splice.apply(sections, argv);
+ }
+
+ result = buff || new Buffer(offset + 16);
+ for (i = 0; i < sections.length; i++) {
+ var word = parseInt(sections[i], 16);
+ result[offset++] = (word >> 8) & 0xff;
+ result[offset++] = word & 0xff;
+ }
+ }
+
+ if (!result) {
+ throw Error('Invalid ip address: ' + ip);
+ }
+
+ return result;
+};
+
+ip.toString = function(buff, offset, length) {
+ offset = ~~offset;
+ length = length || (buff.length - offset);
+
+ var result = [];
+ if (length === 4) {
+ // IPv4
+ for (var i = 0; i < length; i++) {
+ result.push(buff[offset + i]);
+ }
+ result = result.join('.');
+ } else if (length === 16) {
+ // IPv6
+ for (var i = 0; i < length; i += 2) {
+ result.push(buff.readUInt16BE(offset + i).toString(16));
+ }
+ result = result.join(':');
+ result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3');
+ result = result.replace(/:{3,4}/, '::');
+ }
+
+ return result;
+};
+
+var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/;
+var ipv6Regex =
+ /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;
+
+ip.isV4Format = function(ip) {
+ return ipv4Regex.test(ip);
+};
+
+ip.isV6Format = function(ip) {
+ return ipv6Regex.test(ip);
+};
+function _normalizeFamily(family) {
+ return family ? family.toLowerCase() : 'ipv4';
+}
+
+ip.fromPrefixLen = function(prefixlen, family) {
+ if (prefixlen > 32) {
+ family = 'ipv6';
+ } else {
+ family = _normalizeFamily(family);
+ }
+
+ var len = 4;
+ if (family === 'ipv6') {
+ len = 16;
+ }
+ var buff = new Buffer(len);
+
+ for (var i = 0, n = buff.length; i < n; ++i) {
+ var bits = 8;
+ if (prefixlen < 8) {
+ bits = prefixlen;
+ }
+ prefixlen -= bits;
+
+ buff[i] = ~(0xff >> bits) & 0xff;
+ }
+
+ return ip.toString(buff);
+};
+
+ip.mask = function(addr, mask) {
+ addr = ip.toBuffer(addr);
+ mask = ip.toBuffer(mask);
+
+ var result = new Buffer(Math.max(addr.length, mask.length));
+
+ var i = 0;
+ // Same protocol - do bitwise and
+ if (addr.length === mask.length) {
+ for (i = 0; i < addr.length; i++) {
+ result[i] = addr[i] & mask[i];
+ }
+ } else if (mask.length === 4) {
+ // IPv6 address and IPv4 mask
+ // (Mask low bits)
+ for (i = 0; i < mask.length; i++) {
+ result[i] = addr[addr.length - 4 + i] & mask[i];
+ }
+ } else {
+ // IPv6 mask and IPv4 addr
+ for (var i = 0; i < result.length - 6; i++) {
+ result[i] = 0;
+ }
+
+ // ::ffff:ipv4
+ result[10] = 0xff;
+ result[11] = 0xff;
+ for (i = 0; i < addr.length; i++) {
+ result[i + 12] = addr[i] & mask[i + 12];
+ }
+ i = i + 12;
+ }
+ for (; i < result.length; i++)
+ result[i] = 0;
+
+ return ip.toString(result);
+};
+
+ip.cidr = function(cidrString) {
+ var cidrParts = cidrString.split('/');
+
+ var addr = cidrParts[0];
+ if (cidrParts.length !== 2)
+ throw new Error('invalid CIDR subnet: ' + addr);
+
+ var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
+
+ return ip.mask(addr, mask);
+};
+
+ip.subnet = function(addr, mask) {
+ var networkAddress = ip.toLong(ip.mask(addr, mask));
+
+ // Calculate the mask's length.
+ var maskBuffer = ip.toBuffer(mask);
+ var maskLength = 0;
+
+ for (var i = 0; i < maskBuffer.length; i++) {
+ if (maskBuffer[i] === 0xff) {
+ maskLength += 8;
+ } else {
+ var octet = maskBuffer[i] & 0xff;
+ while (octet) {
+ octet = (octet << 1) & 0xff;
+ maskLength++;
+ }
+ }
+ }
+
+ var numberOfAddresses = Math.pow(2, 32 - maskLength);
+
+ return {
+ networkAddress: ip.fromLong(networkAddress),
+ firstAddress: numberOfAddresses <= 2 ?
+ ip.fromLong(networkAddress) :
+ ip.fromLong(networkAddress + 1),
+ lastAddress: numberOfAddresses <= 2 ?
+ ip.fromLong(networkAddress + numberOfAddresses - 1) :
+ ip.fromLong(networkAddress + numberOfAddresses - 2),
+ broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1),
+ subnetMask: mask,
+ subnetMaskLength: maskLength,
+ numHosts: numberOfAddresses <= 2 ?
+ numberOfAddresses : numberOfAddresses - 2,
+ length: numberOfAddresses,
+ contains: function(other) {
+ return networkAddress === ip.toLong(ip.mask(other, mask));
+ }
+ };
+};
+
+ip.cidrSubnet = function(cidrString) {
+ var cidrParts = cidrString.split('/');
+
+ var addr = cidrParts[0];
+ if (cidrParts.length !== 2)
+ throw new Error('invalid CIDR subnet: ' + addr);
+
+ var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
+
+ return ip.subnet(addr, mask);
+};
+
+ip.not = function(addr) {
+ var buff = ip.toBuffer(addr);
+ for (var i = 0; i < buff.length; i++) {
+ buff[i] = 0xff ^ buff[i];
+ }
+ return ip.toString(buff);
+};
+
+ip.or = function(a, b) {
+ a = ip.toBuffer(a);
+ b = ip.toBuffer(b);
+
+ // same protocol
+ if (a.length === b.length) {
+ for (var i = 0; i < a.length; ++i) {
+ a[i] |= b[i];
+ }
+ return ip.toString(a);
+
+ // mixed protocols
+ } else {
+ var buff = a;
+ var other = b;
+ if (b.length > a.length) {
+ buff = b;
+ other = a;
+ }
+
+ var offset = buff.length - other.length;
+ for (var i = offset; i < buff.length; ++i) {
+ buff[i] |= other[i - offset];
+ }
+
+ return ip.toString(buff);
+ }
+};
+
+ip.isEqual = function(a, b) {
+ a = ip.toBuffer(a);
+ b = ip.toBuffer(b);
+
+ // Same protocol
+ if (a.length === b.length) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) return false;
+ }
+ return true;
+ }
+
+ // Swap
+ if (b.length === 4) {
+ var t = b;
+ b = a;
+ a = t;
+ }
+
+ // a - IPv4, b - IPv6
+ for (var i = 0; i < 10; i++) {
+ if (b[i] !== 0) return false;
+ }
+
+ var word = b.readUInt16BE(10);
+ if (word !== 0 && word !== 0xffff) return false;
+
+ for (var i = 0; i < 4; i++) {
+ if (a[i] !== b[i + 12]) return false;
+ }
+
+ return true;
+};
+
+ip.isPrivate = function(addr) {
+ return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i
+ .test(addr) ||
+ /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i
+ .test(addr) ||
+ /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^f[cd][0-9a-f]{2}:/i.test(addr) ||
+ /^fe80:/i.test(addr) ||
+ /^::1$/.test(addr) ||
+ /^::$/.test(addr);
+};
+
+ip.isPublic = function(addr) {
+ return !ip.isPrivate(addr);
+};
+
+ip.isLoopback = function(addr) {
+ return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/
+ .test(addr) ||
+ /^fe80::1$/.test(addr) ||
+ /^::1$/.test(addr) ||
+ /^::$/.test(addr);
+};
+
+ip.loopback = function(family) {
+ //
+ // Default to `ipv4`
+ //
+ family = _normalizeFamily(family);
+
+ if (family !== 'ipv4' && family !== 'ipv6') {
+ throw new Error('family must be ipv4 or ipv6');
+ }
+
+ return family === 'ipv4' ? '127.0.0.1' : 'fe80::1';
+};
+
+//
+// ### function address (name, family)
+// #### @name {string|'public'|'private'} **Optional** Name or security
+// of the network interface.
+// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults
+// to ipv4).
+//
+// Returns the address for the network interface on the current system with
+// the specified `name`:
+// * String: First `family` address of the interface.
+// If not found see `undefined`.
+// * 'public': the first public ip address of family.
+// * 'private': the first private ip address of family.
+// * undefined: First address with `ipv4` or loopback address `127.0.0.1`.
+//
+ip.address = function(name, family) {
+ var interfaces = os.networkInterfaces();
+ var all;
+
+ //
+ // Default to `ipv4`
+ //
+ family = _normalizeFamily(family);
+
+ //
+ // If a specific network interface has been named,
+ // return the address.
+ //
+ if (name && name !== 'private' && name !== 'public') {
+ var res = interfaces[name].filter(function(details) {
+ var itemFamily = details.family.toLowerCase();
+ return itemFamily === family;
+ });
+ if (res.length === 0)
+ return undefined;
+ return res[0].address;
+ }
+
+ var all = Object.keys(interfaces).map(function (nic) {
+ //
+ // Note: name will only be `public` or `private`
+ // when this is called.
+ //
+ var addresses = interfaces[nic].filter(function (details) {
+ details.family = details.family.toLowerCase();
+ if (details.family !== family || ip.isLoopback(details.address)) {
+ return false;
+ } else if (!name) {
+ return true;
+ }
+
+ return name === 'public' ? ip.isPrivate(details.address) :
+ ip.isPublic(details.address);
+ });
+
+ return addresses.length ? addresses[0].address : undefined;
+ }).filter(Boolean);
+
+ return !all.length ? ip.loopback(family) : all[0];
+};
+
+ip.toLong = function(ip) {
+ var ipl = 0;
+ ip.split('.').forEach(function(octet) {
+ ipl <<= 8;
+ ipl += parseInt(octet);
+ });
+ return(ipl >>> 0);
+};
+
+ip.fromLong = function(ipl) {
+ return ((ipl >>> 24) + '.' +
+ (ipl >> 16 & 255) + '.' +
+ (ipl >> 8 & 255) + '.' +
+ (ipl & 255) );
+};
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json
new file mode 100644
index 0000000000..851da5fadc
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json
@@ -0,0 +1,57 @@
+{
+ "_from": "ip@^1.1.4",
+ "_id": "ip@1.1.5",
+ "_integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks/ip",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "ip@^1.1.4",
+ "name": "ip",
+ "escapedName": "ip",
+ "rawSpec": "^1.1.4",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.4"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent/socks"
+ ],
+ "_resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
+ "_shasum": "bdded70114290828c0a039e72ef25f5aaec4354a",
+ "_shrinkwrap": null,
+ "_spec": "ip@^1.1.4",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks",
+ "author": {
+ "name": "Fedor Indutny",
+ "email": "fedor@indutny.com"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/indutny/node-ip/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)",
+ "devDependencies": {
+ "jscs": "^2.1.1",
+ "jshint": "^2.8.0",
+ "mocha": "~1.3.2"
+ },
+ "homepage": "https://github.com/indutny/node-ip",
+ "license": "MIT",
+ "main": "lib/ip",
+ "name": "ip",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/indutny/node-ip.git"
+ },
+ "scripts": {
+ "fix": "jscs lib/*.js test/*.js --fix",
+ "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js"
+ },
+ "version": "1.1.5"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js
new file mode 100644
index 0000000000..2e390f986d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js
@@ -0,0 +1,407 @@
+'use strict';
+
+var ip = require('..');
+var assert = require('assert');
+var net = require('net');
+var os = require('os');
+
+describe('IP library for node.js', function() {
+ describe('toBuffer()/toString() methods', function() {
+ it('should convert to buffer IPv4 address', function() {
+ var buf = ip.toBuffer('127.0.0.1');
+ assert.equal(buf.toString('hex'), '7f000001');
+ assert.equal(ip.toString(buf), '127.0.0.1');
+ });
+
+ it('should convert to buffer IPv4 address in-place', function() {
+ var buf = new Buffer(128);
+ var offset = 64;
+ ip.toBuffer('127.0.0.1', buf, offset);
+ assert.equal(buf.toString('hex', offset, offset + 4), '7f000001');
+ assert.equal(ip.toString(buf, offset, 4), '127.0.0.1');
+ });
+
+ it('should convert to buffer IPv6 address', function() {
+ var buf = ip.toBuffer('::1');
+ assert(/(00){15,15}01/.test(buf.toString('hex')));
+ assert.equal(ip.toString(buf), '::1');
+ assert.equal(ip.toString(ip.toBuffer('1::')), '1::');
+ assert.equal(ip.toString(ip.toBuffer('abcd::dcba')), 'abcd::dcba');
+ });
+
+ it('should convert to buffer IPv6 address in-place', function() {
+ var buf = new Buffer(128);
+ var offset = 64;
+ ip.toBuffer('::1', buf, offset);
+ assert(/(00){15,15}01/.test(buf.toString('hex', offset, offset + 16)));
+ assert.equal(ip.toString(buf, offset, 16), '::1');
+ assert.equal(ip.toString(ip.toBuffer('1::', buf, offset),
+ offset, 16), '1::');
+ assert.equal(ip.toString(ip.toBuffer('abcd::dcba', buf, offset),
+ offset, 16), 'abcd::dcba');
+ });
+
+ it('should convert to buffer IPv6 mapped IPv4 address', function() {
+ var buf = ip.toBuffer('::ffff:127.0.0.1');
+ assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001');
+ assert.equal(ip.toString(buf), '::ffff:7f00:1');
+
+ buf = ip.toBuffer('ffff::127.0.0.1');
+ assert.equal(buf.toString('hex'), 'ffff000000000000000000007f000001');
+ assert.equal(ip.toString(buf), 'ffff::7f00:1');
+
+ buf = ip.toBuffer('0:0:0:0:0:ffff:127.0.0.1');
+ assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001');
+ assert.equal(ip.toString(buf), '::ffff:7f00:1');
+ });
+ });
+
+ describe('fromPrefixLen() method', function() {
+ it('should create IPv4 mask', function() {
+ assert.equal(ip.fromPrefixLen(24), '255.255.255.0');
+ });
+ it('should create IPv6 mask', function() {
+ assert.equal(ip.fromPrefixLen(64), 'ffff:ffff:ffff:ffff::');
+ });
+ it('should create IPv6 mask explicitly', function() {
+ assert.equal(ip.fromPrefixLen(24, 'IPV6'), 'ffff:ff00::');
+ });
+ });
+
+ describe('not() method', function() {
+ it('should reverse bits in address', function() {
+ assert.equal(ip.not('255.255.255.0'), '0.0.0.255');
+ });
+ });
+
+ describe('or() method', function() {
+ it('should or bits in ipv4 addresses', function() {
+ assert.equal(ip.or('0.0.0.255', '192.168.1.10'), '192.168.1.255');
+ });
+ it('should or bits in ipv6 addresses', function() {
+ assert.equal(ip.or('::ff', '::abcd:dcba:abcd:dcba'),
+ '::abcd:dcba:abcd:dcff');
+ });
+ it('should or bits in mixed addresses', function() {
+ assert.equal(ip.or('0.0.0.255', '::abcd:dcba:abcd:dcba'),
+ '::abcd:dcba:abcd:dcff');
+ });
+ });
+
+ describe('mask() method', function() {
+ it('should mask bits in address', function() {
+ assert.equal(ip.mask('192.168.1.134', '255.255.255.0'), '192.168.1.0');
+ assert.equal(ip.mask('192.168.1.134', '::ffff:ff00'), '::ffff:c0a8:100');
+ });
+
+ it('should not leak data', function() {
+ for (var i = 0; i < 10; i++)
+ assert.equal(ip.mask('::1', '0.0.0.0'), '::');
+ });
+ });
+
+ describe('subnet() method', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.192');
+
+ it('should compute ipv4 network address', function() {
+ assert.equal(ipv4Subnet.networkAddress, '192.168.1.128');
+ });
+
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.129');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.190');
+ });
+
+ it('should compute ipv4 broadcast address', function() {
+ assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191');
+ });
+
+ it('should compute ipv4 subnet number of addresses', function() {
+ assert.equal(ipv4Subnet.length, 64);
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 62);
+ });
+
+ it('should compute ipv4 subnet mask', function() {
+ assert.equal(ipv4Subnet.subnetMask, '255.255.255.192');
+ });
+
+ it('should compute ipv4 subnet mask\'s length', function() {
+ assert.equal(ipv4Subnet.subnetMaskLength, 26);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.180'), true);
+ });
+
+ it('should know whether a subnet does not contain an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.195'), false);
+ });
+ });
+
+ describe('subnet() method with mask length 32', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.255');
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 1);
+ });
+ });
+
+ describe('subnet() method with mask length 31', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.254');
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.135');
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 2);
+ });
+ });
+
+ describe('cidrSubnet() method', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.cidrSubnet('192.168.1.134/26');
+
+ it('should compute an ipv4 network address', function() {
+ assert.equal(ipv4Subnet.networkAddress, '192.168.1.128');
+ });
+
+ it('should compute an ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.129');
+ });
+
+ it('should compute an ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.190');
+ });
+
+ it('should compute an ipv4 broadcast address', function() {
+ assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191');
+ });
+
+ it('should compute an ipv4 subnet number of addresses', function() {
+ assert.equal(ipv4Subnet.length, 64);
+ });
+
+ it('should compute an ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 62);
+ });
+
+ it('should compute an ipv4 subnet mask', function() {
+ assert.equal(ipv4Subnet.subnetMask, '255.255.255.192');
+ });
+
+ it('should compute an ipv4 subnet mask\'s length', function() {
+ assert.equal(ipv4Subnet.subnetMaskLength, 26);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.180'), true);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.195'), false);
+ });
+
+ });
+
+ describe('cidr() method', function() {
+ it('should mask address in CIDR notation', function() {
+ assert.equal(ip.cidr('192.168.1.134/26'), '192.168.1.128');
+ assert.equal(ip.cidr('2607:f0d0:1002:51::4/56'), '2607:f0d0:1002::');
+ });
+ });
+
+ describe('isEqual() method', function() {
+ it('should check if addresses are equal', function() {
+ assert(ip.isEqual('127.0.0.1', '::7f00:1'));
+ assert(!ip.isEqual('127.0.0.1', '::7f00:2'));
+ assert(ip.isEqual('127.0.0.1', '::ffff:7f00:1'));
+ assert(!ip.isEqual('127.0.0.1', '::ffaf:7f00:1'));
+ assert(ip.isEqual('::ffff:127.0.0.1', '::ffff:127.0.0.1'));
+ assert(ip.isEqual('::ffff:127.0.0.1', '127.0.0.1'));
+ });
+ });
+
+
+ describe('isPrivate() method', function() {
+ it('should check if an address is localhost', function() {
+ assert.equal(ip.isPrivate('127.0.0.1'), true);
+ });
+
+ it('should check if an address is from a 192.168.x.x network', function() {
+ assert.equal(ip.isPrivate('192.168.0.123'), true);
+ assert.equal(ip.isPrivate('192.168.122.123'), true);
+ assert.equal(ip.isPrivate('192.162.1.2'), false);
+ });
+
+ it('should check if an address is from a 172.16.x.x network', function() {
+ assert.equal(ip.isPrivate('172.16.0.5'), true);
+ assert.equal(ip.isPrivate('172.16.123.254'), true);
+ assert.equal(ip.isPrivate('171.16.0.5'), false);
+ assert.equal(ip.isPrivate('172.25.232.15'), true);
+ assert.equal(ip.isPrivate('172.15.0.5'), false);
+ assert.equal(ip.isPrivate('172.32.0.5'), false);
+ });
+
+ it('should check if an address is from a 169.254.x.x network', function() {
+ assert.equal(ip.isPrivate('169.254.2.3'), true);
+ assert.equal(ip.isPrivate('169.254.221.9'), true);
+ assert.equal(ip.isPrivate('168.254.2.3'), false);
+ });
+
+ it('should check if an address is from a 10.x.x.x network', function() {
+ assert.equal(ip.isPrivate('10.0.2.3'), true);
+ assert.equal(ip.isPrivate('10.1.23.45'), true);
+ assert.equal(ip.isPrivate('12.1.2.3'), false);
+ });
+
+ it('should check if an address is from a private IPv6 network', function() {
+ assert.equal(ip.isPrivate('fd12:3456:789a:1::1'), true);
+ assert.equal(ip.isPrivate('fe80::f2de:f1ff:fe3f:307e'), true);
+ assert.equal(ip.isPrivate('::ffff:10.100.1.42'), true);
+ assert.equal(ip.isPrivate('::FFFF:172.16.200.1'), true);
+ assert.equal(ip.isPrivate('::ffff:192.168.0.1'), true);
+ });
+
+ it('should check if an address is from the internet', function() {
+ assert.equal(ip.isPrivate('165.225.132.33'), false); // joyent.com
+ });
+
+ it('should check if an address is a loopback IPv6 address', function() {
+ assert.equal(ip.isPrivate('::'), true);
+ assert.equal(ip.isPrivate('::1'), true);
+ assert.equal(ip.isPrivate('fe80::1'), true);
+ });
+ });
+
+ describe('loopback() method', function() {
+ describe('undefined', function() {
+ it('should respond with 127.0.0.1', function() {
+ assert.equal(ip.loopback(), '127.0.0.1')
+ });
+ });
+
+ describe('ipv4', function() {
+ it('should respond with 127.0.0.1', function() {
+ assert.equal(ip.loopback('ipv4'), '127.0.0.1')
+ });
+ });
+
+ describe('ipv6', function() {
+ it('should respond with fe80::1', function() {
+ assert.equal(ip.loopback('ipv6'), 'fe80::1')
+ });
+ });
+ });
+
+ describe('isLoopback() method', function() {
+ describe('127.0.0.1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('127.0.0.1'))
+ });
+ });
+
+ describe('127.8.8.8', function () {
+ it('should respond with true', function () {
+ assert.ok(ip.isLoopback('127.8.8.8'))
+ });
+ });
+
+ describe('8.8.8.8', function () {
+ it('should respond with false', function () {
+ assert.equal(ip.isLoopback('8.8.8.8'), false);
+ });
+ });
+
+ describe('fe80::1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('fe80::1'))
+ });
+ });
+
+ describe('::1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('::1'))
+ });
+ });
+
+ describe('::', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('::'))
+ });
+ });
+ });
+
+ describe('address() method', function() {
+ describe('undefined', function() {
+ it('should respond with a private ip', function() {
+ assert.ok(ip.isPrivate(ip.address()));
+ });
+ });
+
+ describe('private', function() {
+ [ undefined, 'ipv4', 'ipv6' ].forEach(function(family) {
+ describe(family, function() {
+ it('should respond with a private ip', function() {
+ assert.ok(ip.isPrivate(ip.address('private', family)));
+ });
+ });
+ });
+ });
+
+ var interfaces = os.networkInterfaces();
+
+ Object.keys(interfaces).forEach(function(nic) {
+ describe(nic, function() {
+ [ undefined, 'ipv4' ].forEach(function(family) {
+ describe(family, function() {
+ it('should respond with an ipv4 address', function() {
+ var addr = ip.address(nic, family);
+ assert.ok(!addr || net.isIPv4(addr));
+ });
+ });
+ });
+
+ describe('ipv6', function() {
+ it('should respond with an ipv6 address', function() {
+ var addr = ip.address(nic, 'ipv6');
+ assert.ok(!addr || net.isIPv6(addr));
+ });
+ })
+ });
+ });
+ });
+
+ describe('toLong() method', function() {
+ it('should respond with a int', function() {
+ assert.equal(ip.toLong('127.0.0.1'), 2130706433);
+ assert.equal(ip.toLong('255.255.255.255'), 4294967295);
+ });
+ });
+
+ describe('fromLong() method', function() {
+ it('should repond with ipv4 address', function() {
+ assert.equal(ip.fromLong(2130706433), '127.0.0.1');
+ assert.equal(ip.fromLong(4294967295), '255.255.255.255');
+ });
+ })
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore
new file mode 100644
index 0000000000..6bcbf6f77d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore
@@ -0,0 +1,5 @@
+.git*
+.idea*
+node_modules/
+npm-debug.log
+coverage \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml
new file mode 100644
index 0000000000..9d67de5878
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml
@@ -0,0 +1,11 @@
+language: node_js
+node_js:
+ - 0.10
+ - 0.12
+ - 4
+ - 6
+ - stable
+
+script: "npm run coverage"
+# Send coverage data to Coveralls
+after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE
new file mode 100644
index 0000000000..b2442a9e71
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Josh Glazebrook
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md
new file mode 100644
index 0000000000..178ce8827f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md
@@ -0,0 +1,307 @@
+smart-buffer [![Build Status](https://travis-ci.org/JoshGlazebrook/smart-buffer.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/smart-buffer) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/smart-buffer/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/smart-buffer?branch=master)
+=============
+
+smart-buffer is a light Buffer wrapper that takes away the need to keep track of what position to read and write data to and from the underlying Buffer. It also adds null terminating string operations and **grows** as you add more data.
+
+
+### What it's useful for:
+
+I created smart-buffer because I wanted to simplify the process of using Buffer for building and reading network packets to send over a socket. Rather than having to keep track of which position I need to write a UInt16 to after adding a string of variable length, I simply don't have to.
+
+Key Features:
+* Proxies all of the Buffer write and read functions.
+* Keeps track of read and write positions for you.
+* Grows the internal Buffer as you add data to it.
+* Useful string operations. (Null terminating strings)
+* Allows for inserting values at specific points in the internal Buffer.
+
+#### Note:
+smart-buffer can be used for writing to an underlying buffer as well as reading from it. It however does not function correctly if you're mixing both read and write operations with each other.
+
+## Installing:
+
+`npm install smart-buffer`
+
+## Using smart-buffer
+
+### Example
+
+Say you were building a packet that had to conform to the following protocol:
+
+`[PacketType:2][PacketLength:2][Data:XX]`
+
+To build this packet using the vanilla Buffer class, you would have to count up the length of the data payload beforehand. You would also need to keep track of the current "cursor" position in your Buffer so you write everything in the right places. With smart-buffer you don't have to do either of those things.
+
+```javascript
+function createLoginPacket(username, password, age, country) {
+ var packet = new SmartBuffer();
+ packet.writeUInt16LE(0x0060); // Login Packet Type/ID
+ packet.writeStringNT(username);
+ packet.writeStringNT(password);
+ packet.writeUInt8(age);
+ packet.writeStringNT(country);
+ packet.writeUInt16LE(packet.length - 2, 2);
+
+ return packet.toBuffer();
+}
+```
+With the above function, you now can do this:
+```javascript
+var login = createLoginPacket("Josh", "secret123", 22, "United States");
+
+// <Buffer 60 00 1e 00 4a 6f 73 68 00 73 65 63 72 65 74 31 32 33 00 16 55 6e 69 74 65 64 20 53 74 61 74 65 73 00>
+```
+Notice that the `[PacketLength:2]` part of the packet was inserted after we had added everything else, and as shown in the Buffer dump above, is in the correct location along with everything else.
+
+Reading back the packet we created above is just as easy:
+```javascript
+
+var reader = new SmartBuffer(login);
+
+var logininfo = {
+ packetType: reader.readUInt16LE(),
+ packetLength: reader.readUInt16LE(),
+ username: reader.readStringNT(),
+ password: reader.readStringNT(),
+ age: reader.readUInt8(),
+ country: reader.readStringNT()
+};
+
+/*
+{
+ packetType: 96, (0x0060)
+ packetLength: 30,
+ username: 'Josh',
+ password: 'secret123',
+ age: 22,
+ country: 'United States'
+};
+*/
+```
+
+# Api Reference:
+
+### Constructing a smart-buffer
+
+smart-buffer has a few different constructor signatures you can use. By default, utf8 encoding is used, and the internal Buffer length will be 4096. When reading from a Buffer, smart-buffer does NOT make a copy of the Buffer. It reads from the Buffer it was given.
+
+```javascript
+var SmartBuffer = require('smart-buffer');
+
+// Reading from an existing Buffer:
+var reader = new SmartBuffer(buffer);
+var reader = new SmartBuffer(buffer, 'ascii');
+
+// Writing to a new Buffer:
+var writer = new SmartBuffer(); // Defaults to utf8, 4096 length internal Buffer.
+var writer = new SmartBuffer(1024); // Defaults to utf8, 1024 length internal Buffer.
+var writer = new SmartBuffer('ascii'); // Sets to ascii encoding, 4096 length internal buffer.
+var writer = new SmartBuffer(1024, 'ascii'); // Sets to ascii encoding, 1024 length internal buffer.
+```
+
+## Reading Data
+
+smart-buffer supports all of the common read functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to start reading from. This is possible because as you read data out of a smart-buffer, it automatically progresses an internal read offset/position to know where to pick up from on the next read.
+
+## Reading Numeric Values
+
+When numeric values, you simply need to call the function you want, and the data is returned.
+
+Supported Operations:
+* readInt8
+* readInt16BE
+* readInt16LE
+* readInt32BE
+* readInt32LE
+* readUInt8
+* readUInt16BE
+* readUInt16LE
+* readUInt32BE
+* readUInt32LE
+* readFloatBE
+* readFloatLE
+* readDoubleBE
+* readDoubleLE
+
+```javascript
+var reader = new SmartBuffer(somebuffer);
+var num = reader.readInt8();
+```
+
+## Reading String Values
+
+When reading String values, you can either choose to read a null terminated string, or a string of a specified length.
+
+### SmartBuffer.readStringNT( [encoding] )
+> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String`
+
+> Note: When readStringNT is called and there is no null character found, smart-buffer will read to the end of the internal Buffer.
+
+### SmartBuffer.readString( [length], [encoding] )
+### SmartBuffer.readString( [length] )
+### SmartBuffer.readString( [encoding] )
+> `Number` **Length of the string to read**
+
+> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String`
+
+> Note: When readString is called without a specified length, smart-buffer will read to the end of the internal Buffer.
+
+
+
+## Reading Buffer Values
+
+### SmartBuffer.readBuffer( length )
+> `Number` **Length of data to read into a Buffer**
+
+returns `Buffer`
+
+> Note: This function uses `slice` to retrieve the Buffer.
+
+
+### SmartBuffer.readBufferNT()
+
+returns `Buffer`
+
+> Note: This reads the next sequence of bytes in the buffer until a null (0x00) value is found. (Null terminated buffer)
+> Note: This function uses `slice` to retrieve the Buffer.
+
+
+## Writing Data
+
+smart-buffer supports all of the common write functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to write to in your Buffer by default. You do however have the option of **inserting** a piece of data into your smart-buffer at a given location.
+
+
+## Writing Numeric Values
+
+
+For numeric values, you simply need to call the function you want, and the data is written at the end of the internal Buffer's current write position. You can specify a offset/position to **insert** the given value at, but keep in mind this does not override data at the given position. This feature also does not work properly when inserting a value beyond the current internal length of the smart-buffer (length being the .length property of the smart-buffer instance you're writing to)
+
+Supported Operations:
+* writeInt8
+* writeInt16BE
+* writeInt16LE
+* writeInt32BE
+* writeInt32LE
+* writeUInt8
+* writeUInt16BE
+* writeUInt16LE
+* writeUInt32BE
+* writeUInt32LE
+* writeFloatBE
+* writeFloatLE
+* writeDoubleBE
+* writeDoubleLE
+
+The following signature is the same for all the above functions:
+
+### SmartBuffer.writeInt8( value, [offset] )
+> `Number` **A valid Int8 number**
+
+> `Number` **The position to insert this value at**
+
+returns this
+
+> Note: All write operations return `this` to allow for chaining.
+
+## Writing String Values
+
+When reading String values, you can either choose to write a null terminated string, or a non null terminated string.
+
+### SmartBuffer.writeStringNT( value, [offset], [encoding] )
+### SmartBuffer.writeStringNT( value, [offset] )
+### SmartBuffer.writeStringNT( value, [encoding] )
+> `String` **String value to write**
+
+> `Number` **The position to insert this String at**
+
+> `String` **The String encoding to use.** - Defaults to the encoding set in the constructor, or utf8.
+
+returns this
+
+### SmartBuffer.writeString( value, [offset], [encoding] )
+### SmartBuffer.writeString( value, [offset] )
+### SmartBuffer.writeString( value, [encoding] )
+> `String` **String value to write**
+
+> `Number` **The position to insert this String at**
+
+> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns this
+
+
+## Writing Buffer Values
+
+### SmartBuffer.writeBuffer( value, [offset] )
+> `Buffer` **Buffer value to write**
+
+> `Number` **The position to insert this Buffer's content at**
+
+returns this
+
+### SmartBuffer.writeBufferNT( value, [offset] )
+> `Buffer` **Buffer value to write**
+
+> `Number` **The position to insert this Buffer's content at**
+
+returns this
+
+
+## Utility Functions
+
+### SmartBuffer.clear()
+Resets the SmartBuffer to its default state where it can be reused for reading or writing.
+
+### SmartBuffer.remaining()
+
+returns `Number` The amount of data left to read based on the current read Position.
+
+### SmartBuffer.skip( value )
+> `Number` **The amount of bytes to skip ahead**
+
+Skips the read position ahead by the given value.
+
+returns this
+
+### SmartBuffer.rewind( value )
+> `Number` **The amount of bytes to reward backwards**
+
+Rewinds the read position backwards by the given value.
+
+returns this
+
+### SmartBuffer.skipTo( position )
+> `Number` **The point to skip the read position to**
+
+Moves the read position to the given point.
+returns this
+
+### SmartBuffer.toBuffer()
+
+returns `Buffer` A Buffer containing the contents of the internal Buffer.
+
+> Note: This uses the slice function.
+
+### SmartBuffer.toString( [encoding] )
+> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String` The internal Buffer in String representation.
+
+### SmartBuffer.destroy()
+Attempts to destroy the smart-buffer.
+
+returns this
+
+## Properties
+
+### SmartBuffer.length
+
+returns `Number` **The length of the data that is being tracked in the internal Buffer** - Does NOT return the absolute length of the internal Buffer being written to.
+
+## License
+
+This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js
new file mode 100644
index 0000000000..ef53b9fd4d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js
@@ -0,0 +1,726 @@
+"use strict";
+// The default Buffer size if one is not provided.
+const DEFAULT_SMARTBUFFER_SIZE = 4096;
+// The default string encoding to use for reading/writing strings.
+const DEFAULT_SMARTBUFFER_ENCODING = 'utf8';
+class SmartBuffer {
+ /**
+ * Creates a new SmartBuffer instance.
+ *
+ * @param arg1 { Number | BufferEncoding | Buffer | SmartBufferOptions }
+ * @param arg2 { BufferEncoding }
+ */
+ constructor(arg1, arg2) {
+ this.length = 0;
+ this.encoding = DEFAULT_SMARTBUFFER_ENCODING;
+ this.writeOffset = 0;
+ this.readOffset = 0;
+ // Initial buffer size provided
+ if (typeof arg1 === 'number') {
+ if (Number.isFinite(arg1) && Number.isInteger(arg1) && arg1 > 0) {
+ this.buff = Buffer.allocUnsafe(arg1);
+ }
+ else {
+ throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
+ }
+ }
+ else if (typeof arg1 === 'string') {
+ if (Buffer.isEncoding(arg1)) {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ this.encoding = arg1;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ else if (arg1 instanceof Buffer) {
+ this.buff = arg1;
+ this.length = arg1.length;
+ }
+ else if (SmartBuffer.isSmartBufferOptions(arg1)) {
+ // Checks for encoding
+ if (arg1.encoding) {
+ if (Buffer.isEncoding(arg1.encoding)) {
+ this.encoding = arg1.encoding;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Checks for initial size length
+ if (arg1.size) {
+ if (Number.isFinite(arg1.size) && Number.isInteger(arg1.size) && arg1.size > 0) {
+ this.buff = Buffer.allocUnsafe(arg1.size);
+ }
+ else {
+ throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
+ }
+ }
+ else if (arg1.buff) {
+ if (arg1.buff instanceof Buffer) {
+ this.buff = arg1.buff;
+ this.length = arg1.buff.length;
+ }
+ else {
+ throw new Error('Invalid buffer provided in SmartBufferOptions.');
+ }
+ }
+ else {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ }
+ }
+ else if (typeof arg1 === 'object') {
+ throw new Error('Invalid object supplied to SmartBuffer constructor.');
+ }
+ else {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ }
+ // Check for encoding (Buffer, Encoding) constructor.
+ if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ this.encoding = arg2;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
+ *
+ * @param size { Number } The size of the internal Buffer.
+ * @param encoding { String } The BufferEncoding to use for strings.
+ *
+ * @return { SmartBuffer }
+ */
+ static fromSize(size, encoding) {
+ return new this({
+ size: size,
+ encoding: encoding
+ });
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
+ *
+ * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
+ * @param encoding { String } The BufferEncoding to use for strings.
+ *
+ * @return { SmartBuffer }
+ */
+ static fromBuffer(buff, encoding) {
+ return new this({
+ buff: buff,
+ encoding: encoding
+ });
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
+ *
+ * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
+ */
+ static fromOptions(options) {
+ return new this(options);
+ }
+ /**
+ * Ensures that the internal Buffer is large enough to write data.
+ *
+ * @param minLength { Number } The minimum length of the data that needs to be written.
+ * @param offset { Number } The offset of the data to be written.
+ */
+ ensureWriteable(minLength, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : 0;
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureCapacity(this.length + minLength + offsetVal);
+ // If offset is provided, copy data into appropriate location in regards to the offset.
+ if (typeof offset === 'number') {
+ this.buff.copy(this.buff, offsetVal + minLength, offsetVal, this.buff.length);
+ }
+ // Adjust instance length.
+ this.length = Math.max(this.length + minLength, offsetVal + minLength);
+ }
+ /**
+ * Ensures that the internal Buffer is large enough to write at least the given amount of data.
+ *
+ * @param minLength { Number } The minimum length of the data needs to be written.
+ */
+ ensureCapacity(minLength) {
+ const oldLength = this.buff.length;
+ if (minLength > oldLength) {
+ let data = this.buff;
+ let newLength = (oldLength * 3) / 2 + 1;
+ if (newLength < minLength) {
+ newLength = minLength;
+ }
+ this.buff = Buffer.allocUnsafe(newLength);
+ data.copy(this.buff, 0, 0, oldLength);
+ }
+ }
+ /**
+ * Reads a numeric number value using the provided function.
+ *
+ * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
+ * @param byteSize { Number } The number of bytes read.
+ *
+ * @param { Number }
+ */
+ readNumberValue(func, byteSize) {
+ // Call Buffer.readXXXX();
+ const value = func.call(this.buff, this.readOffset);
+ // Adjust internal read offset
+ this.readOffset += byteSize;
+ return value;
+ }
+ /**
+ * Writes a numeric number value using the provided function.
+ *
+ * @param func { Function(offset: number, offset?) => number} The function to write data on the internal Buffer with.
+ * @param byteSize { Number } The number of bytes written.
+ * @param value { Number } The number value to write.
+ * @param offset { Number } the offset to write the number at.
+ *
+ */
+ writeNumberValue(func, byteSize, value, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
+ // Ensure there is enough internal Buffer capacity. (raw offset is passed)
+ this.ensureWriteable(byteSize, offset);
+ // Call buffer.writeXXXX();
+ func.call(this.buff, value, offsetVal);
+ // Adjusts internal write offset
+ this.writeOffset += byteSize;
+ }
+ // Signed integers
+ /**
+ * Reads an Int8 value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt8() {
+ return this.readNumberValue(Buffer.prototype.readUInt8, 1);
+ }
+ /**
+ * Reads an Int16BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt16BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
+ }
+ /**
+ * Reads an Int16LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt16LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
+ }
+ /**
+ * Reads an Int32BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt32BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
+ }
+ /**
+ * Reads an Int32LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt32LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
+ }
+ /**
+ * Writes an Int8 value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt8(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int16BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt16BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int16LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt16LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int32BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt32BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int32LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt32LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
+ return this;
+ }
+ // Unsigned Integers
+ /**
+ * Reads an UInt8 value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt8() {
+ return this.readNumberValue(Buffer.prototype.readUInt8, 1);
+ }
+ /**
+ * Reads an UInt16BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt16BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
+ }
+ /**
+ * Reads an UInt16LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt16LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
+ }
+ /**
+ * Reads an UInt32BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt32BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
+ }
+ /**
+ * Reads an UInt32LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt32LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
+ }
+ /**
+ * Writes an UInt8 value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt8(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt16BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt16BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt16LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt16LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt32BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt32BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt32LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt32LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
+ return this;
+ }
+ // Floating Point
+ /**
+ * Reads an FloatBE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readFloatBE() {
+ return this.readNumberValue(Buffer.prototype.readFloatBE, 4);
+ }
+ /**
+ * Reads an FloatLE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readFloatLE() {
+ return this.readNumberValue(Buffer.prototype.readFloatLE, 4);
+ }
+ /**
+ * Writes a FloatBE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeFloatBE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes a FloatLE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeFloatLE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
+ return this;
+ }
+ // Double Floating Point
+ /**
+ * Reads an DoublEBE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readDoubleBE() {
+ return this.readNumberValue(Buffer.prototype.readDoubleBE, 8);
+ }
+ /**
+ * Reads an DoubleLE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readDoubleLE() {
+ return this.readNumberValue(Buffer.prototype.readDoubleLE, 8);
+ }
+ /**
+ * Writes a DoubleBE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeDoubleBE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
+ return this;
+ }
+ /**
+ * Writes a DoubleLE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeDoubleLE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
+ return this;
+ }
+ // Strings
+ /**
+ * Reads a String from the current read position.
+ *
+ * @param length { Number } The number of bytes to read as a String.
+ * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
+ *
+ * @return { String }
+ */
+ readString(length, encoding) {
+ const lengthVal = Math.min(length, this.length - this.readOffset) || this.length - this.readOffset;
+ const value = this.buff.slice(this.readOffset, this.readOffset + lengthVal).toString(encoding || this.encoding);
+ this.readOffset += lengthVal;
+ return value;
+ }
+ /**
+ * Writes a String to the current write position.
+ *
+ * @param value { String } The String value to write.
+ * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
+ * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
+ */
+ writeString(value, arg2, encoding) {
+ let offsetVal = this.writeOffset;
+ let encodingVal = this.encoding;
+ // Check for offset
+ if (typeof arg2 === 'number') {
+ offsetVal = arg2;
+ }
+ else if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ encodingVal = arg2;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Check for encoding (third param)
+ if (typeof encoding === 'string') {
+ if (Buffer.isEncoding(encoding)) {
+ encodingVal = encoding;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Calculate bytelength of string.
+ const byteLength = Buffer.byteLength(value, encodingVal);
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureWriteable(byteLength, offsetVal);
+ // Write value
+ this.buff.write(value, offsetVal, byteLength, encodingVal);
+ // Increment internal Buffer write offset;
+ this.writeOffset += byteLength;
+ return this;
+ }
+ /**
+ * Reads a null-terminated String from the current read position.
+ *
+ * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
+ *
+ * @return { String }
+ */
+ readStringNT(encoding) {
+ // Set null character position to the end SmartBuffer instance.
+ let nullPos = this.length;
+ // Find next null character (if one is not found, default from above is used)
+ for (let i = this.readOffset; i < this.length; i++) {
+ if (this.buff[i] === 0x00) {
+ nullPos = i;
+ break;
+ }
+ }
+ // Read string value
+ const value = this.buff.slice(this.readOffset, nullPos);
+ // Increment internal Buffer read offset
+ this.readOffset = nullPos + 1;
+ return value.toString(encoding || this.encoding);
+ }
+ /**
+ * Writes a null-terminated String to the current write position.
+ *
+ * @param value { String } The String value to write.
+ * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
+ * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
+ */
+ writeStringNT(value, offset, encoding) {
+ // Write Values
+ this.writeString(value, offset, encoding);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
+ }
+ // Buffers
+ /**
+ * Reads a Buffer from the internal read position.
+ *
+ * @param length { Number } The length of data to read as a Buffer.
+ *
+ * @return { Buffer }
+ */
+ readBuffer(length) {
+ const lengthVal = typeof length === 'number' ? length : this.length;
+ const endPoint = Math.min(this.length, this.readOffset + lengthVal);
+ // Read buffer value
+ const value = this.buff.slice(this.readOffset, endPoint);
+ // Increment internal Buffer read offset
+ this.readOffset = endPoint;
+ return value;
+ }
+ /**
+ * Writes a Buffer to the current write position.
+ *
+ * @param value { Buffer } The Buffer to write.
+ * @param offset { Number } The offset to write the Buffer to.
+ */
+ writeBuffer(value, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureWriteable(value.length, offsetVal);
+ // Write buffer value
+ value.copy(this.buff, offsetVal);
+ // Increment internal Buffer write offset
+ this.writeOffset += value.length;
+ return this;
+ }
+ /**
+ * Reads a null-terminated Buffer from the current read poisiton.
+ *
+ * @return { Buffer }
+ */
+ readBufferNT() {
+ // Set null character position to the end SmartBuffer instance.
+ let nullPos = this.length;
+ // Find next null character (if one is not found, default from above is used)
+ for (let i = this.readOffset; i < this.length; i++) {
+ if (this.buff[i] === 0x00) {
+ nullPos = i;
+ break;
+ }
+ }
+ // Read value
+ const value = this.buff.slice(this.readOffset, nullPos);
+ // Increment internal Buffer read offset
+ this.readOffset = nullPos + 1;
+ return value;
+ }
+ /**
+ * Writes a null-terminated Buffer to the current write position.
+ *
+ * @param value { Buffer } The Buffer to write.
+ * @param offset { Number } The offset to write the Buffer to.
+ */
+ writeBufferNT(value, offset) {
+ // Write Values
+ this.writeBuffer(value, offset);
+ this.writeUInt8(0, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
+ return this;
+ }
+ /**
+ * Clears the SmartBuffer instance to its original empty state.
+ */
+ clear() {
+ this.writeOffset = 0;
+ this.readOffset = 0;
+ this.length = 0;
+ }
+ /**
+ * Gets the remaining data left to be read from the SmartBuffer instance.
+ *
+ * @return { Number }
+ */
+ remaining() {
+ return this.length - this.readOffset;
+ }
+ /**
+ * Moves the read offset forward.
+ *
+ * @param amount { Number } The amount to move the read offset forward by.
+ */
+ skip(amount) {
+ if (this.readOffset + amount > this.length) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset += amount;
+ }
+ /**
+ * Moves the read offset backwards.
+ *
+ * @param amount { Number } The amount to move the read offset backwards by.
+ */
+ rewind(amount) {
+ if (this.readOffset - amount < 0) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset -= amount;
+ }
+ /**
+ * Moves the read offset to a specific position.
+ *
+ * @param position { Number } The position to move the read offset to.
+ */
+ skipTo(position) {
+ this.moveTo(position);
+ }
+ /**
+ * Moves the read offset to a specific position.
+ *
+ * @param position { Number } The position to move the read offset to.
+ */
+ moveTo(position) {
+ if (position > this.length) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset = position;
+ }
+ /**
+ * Gets the value of the internal managed Buffer
+ *
+ * @param { Buffer }
+ */
+ toBuffer() {
+ return this.buff.slice(0, this.length);
+ }
+ /**
+ * Gets the String value of the internal managed Buffer
+ *
+ * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
+ */
+ toString(encoding) {
+ const encodingVal = typeof encoding === 'string' ? encoding : this.encoding;
+ if (Buffer.isEncoding(encodingVal)) {
+ return this.buff.toString(encodingVal, 0, this.length);
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ /**
+ * Destroys the SmartBuffer instance.
+ */
+ destroy() {
+ this.clear();
+ }
+ /**
+ * Type checking function that determines if an object is a SmartBufferOptions object.
+ */
+ static isSmartBufferOptions(options) {
+ const castOptions = options;
+ return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);
+ }
+}
+module.exports = SmartBuffer;
+//# sourceMappingURL=smartbuffer.js.map \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map
new file mode 100644
index 0000000000..60af067a2c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map
@@ -0,0 +1 @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ules/socks/node_modules/smart-buffer/lib/smart-buffer.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js
new file mode 100644
index 0000000000..ea69cfc09a
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js
@@ -0,0 +1,371 @@
+var SmartBuffer = (function () {
+
+ /**
+ * Constructor for SmartBuffer.
+ * @param arg1 {Buffer || Number || String} Buffer to read from, or expected size to write to, or encoding to use.
+ * @param arg2 {String} Encoding to use for writing and reading strings. Defaults to utf8. If encoding is given in arg1, this is ignored.
+ * @constructor
+ *
+ * There are a few ways to construct a SmartBuffer:
+ *
+ * SmartBuffer() - Defaults to utf8, 4096 pre-set internal Buffer length.
+ * SmartBuffer(size) - Defaults to utf8, sets internal Buffer length to the size given.
+ * SmartBuffer(encoding) - Sets the given encoding, defaults to 4096 pre-set internal Buffer length.
+ * SmartBuffer(Buffer) - Defaults to utf8, sets the internal Buffer to the given buffer (same memory).
+ * SmartBuffer(Buffer, encoding) - Sets the given encoding, sets the internal Buffer to the given buffer (same memory).
+ *
+ */
+ function SmartBuffer(arg1, arg2) {
+ var type;
+ switch (type = typeof arg1) {
+ case 'number':
+ if (isFinite(arg1) && arg1 > 0) {
+ this.buff = new Buffer(Math.ceil(arg1));
+ this.length = 0;
+ } else {
+ throw new Error('When specifying a size, it must be a valid number above zero.');
+ }
+ break;
+
+ case 'string':
+ if (Buffer.isEncoding(arg1)) {
+ this.buff = new Buffer(4096);
+ this.length = 0;
+ this.encoding = arg1;
+ } else {
+ throw new Error('Invalid Encoding');
+ }
+ break;
+
+ case 'object':
+ if (Buffer.isBuffer(arg1)) {
+ this.buff = arg1;
+ this.length = arg1.length;
+ } else {
+ throw new TypeError('First argument must be a Buffer, Number representing the size, or a String representing the encoding.');
+ }
+ break;
+
+ default:
+ this.buff = new Buffer(4096);
+ this.length = 0;
+ break;
+ }
+
+ if (typeof this.encoding === 'undefined') {
+ if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ this.encoding = arg2;
+ } else {
+ throw new Error('Invalid Encoding');
+ }
+ }
+ }
+
+ this._readOffset = 0;
+ this._writeOffset = 0;
+ }
+
+
+ SmartBuffer.prototype._ensureWritable = function (len, offset) {
+ this._ensureCapacity(this.length + len + (typeof offset === 'number' ? offset : 0));
+
+ if (typeof offset === 'number') {
+ this.buff.copy(this.buff, offset + len, offset, this.buff.length);
+ }
+ this.length = Math.max(this.length + len, (typeof offset === 'number' ? offset : 0) + len);
+ };
+
+ SmartBuffer.prototype._ensureCapacity = function (minlen) {
+ var oldlen = this.buff.length;
+
+ if (minlen > oldlen) {
+ var data = this.buff;
+ var newlen = (oldlen * 3) / 2 + 1;
+ if (newlen < minlen)
+ newlen = minlen;
+ this.buff = new Buffer(newlen);
+ data.copy(this.buff, 0, 0, oldlen);
+ }
+ };
+
+
+ var makeReader = function (func, size) {
+ return function () {
+ var ret = func.call(this.buff, this._readOffset);
+ this._readOffset += size;
+ return ret;
+ }
+ };
+
+ var makeWriter = function (func, size) {
+ return function (value, offset) {
+ this._ensureWritable(size, offset);
+ func.call(this.buff, value, typeof offset === 'number' ? offset : this._writeOffset);
+ this._writeOffset += size;
+ return this;
+ }
+ };
+
+
+ /*
+ Read Operations
+ */
+
+ SmartBuffer.prototype.readInt8 = makeReader(Buffer.prototype.readInt8, 1);
+ SmartBuffer.prototype.readInt16BE = makeReader(Buffer.prototype.readInt16BE, 2);
+ SmartBuffer.prototype.readInt16LE = makeReader(Buffer.prototype.readInt16LE, 2);
+ SmartBuffer.prototype.readInt32BE = makeReader(Buffer.prototype.readInt32BE, 4);
+ SmartBuffer.prototype.readInt32LE = makeReader(Buffer.prototype.readInt32LE, 4);
+
+ SmartBuffer.prototype.readUInt8 = makeReader(Buffer.prototype.readUInt8, 1);
+ SmartBuffer.prototype.readUInt16BE = makeReader(Buffer.prototype.readUInt16BE, 2);
+ SmartBuffer.prototype.readUInt16LE = makeReader(Buffer.prototype.readUInt16LE, 2);
+ SmartBuffer.prototype.readUInt32BE = makeReader(Buffer.prototype.readUInt32BE, 4);
+ SmartBuffer.prototype.readUInt32LE = makeReader(Buffer.prototype.readUInt32LE, 4);
+
+ SmartBuffer.prototype.readFloatBE = makeReader(Buffer.prototype.readFloatBE, 4);
+ SmartBuffer.prototype.readFloatLE = makeReader(Buffer.prototype.readFloatLE, 4);
+
+ SmartBuffer.prototype.readDoubleBE = makeReader(Buffer.prototype.readDoubleBE, 8);
+ SmartBuffer.prototype.readDoubleLE = makeReader(Buffer.prototype.readDoubleLE, 8);
+
+
+ /**
+ * Reads a string of the given length.
+ * @param length {Number} The length of the string to read. (Defaults to the length of the remaining data)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or utf8)
+ * @returns {string} The string.
+ */
+ SmartBuffer.prototype.readString = function (length, encoding) {
+ var len = Math.min(length, this.length - this._readOffset) || (this.length - this._readOffset);
+ var ret = this.buff.slice(this._readOffset, this._readOffset + len).toString(encoding || this.encoding);
+ this._readOffset += len;
+ return ret;
+ };
+
+ /**
+ * Reads a null terminated string from the underlying buffer.
+ * @param encoding {String} Encoding to use. Defaults to encoding set in constructor, or utf8.
+ * @returns {string}
+ */
+ SmartBuffer.prototype.readStringNT = function (encoding) {
+ var nullpos = this.length;
+ for (var i = this._readOffset; i < this.length; i++) {
+ if (this.buff[i] == 0x00) {
+ nullpos = i;
+ break;
+ }
+ }
+
+ var result = this.buff.slice(this._readOffset, nullpos);
+ this._readOffset = nullpos + 1;
+
+ return result.toString(encoding || this.encoding);
+ };
+
+
+ /**
+ * Reads a specified number of bytes.
+ * @param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
+ * @returns {Buffer} Buffer containing the read bytes.
+ */
+ SmartBuffer.prototype.readBuffer = function (len) {
+ var endpoint = Math.min(this.length, this._readOffset + (typeof len === 'number' ? len : this.length));
+ var ret = this.buff.slice(this._readOffset, endpoint);
+ this._readOffset = endpoint;
+ return ret;
+ };
+
+ /**
+ * Reads a null terminated sequence of bytes from the underlying buffer.
+ * @returns {Buffer} Buffer containing the read bytes.
+ */
+ SmartBuffer.prototype.readBufferNT = function () {
+ var nullpos = this.length;
+ for (var i = this._readOffset; i < this.length; i++) {
+ if (this.buff[i] == 0x00) {
+ nullpos = i;
+ break;
+ }
+ }
+
+ var ret = this.buff.slice(this._readOffset, nullpos);
+ this._readOffset = nullpos + 1;
+
+ return ret;
+ };
+
+
+ /*
+ Write Operations
+ */
+
+
+ SmartBuffer.prototype.writeInt8 = makeWriter(Buffer.prototype.writeInt8, 1);
+ SmartBuffer.prototype.writeInt16BE = makeWriter(Buffer.prototype.writeInt16BE, 2);
+ SmartBuffer.prototype.writeInt16LE = makeWriter(Buffer.prototype.writeInt16LE, 2);
+ SmartBuffer.prototype.writeInt32BE = makeWriter(Buffer.prototype.writeInt32BE, 4);
+ SmartBuffer.prototype.writeInt32LE = makeWriter(Buffer.prototype.writeInt32LE, 4);
+
+ SmartBuffer.prototype.writeUInt8 = makeWriter(Buffer.prototype.writeUInt8, 1);
+ SmartBuffer.prototype.writeUInt16BE = makeWriter(Buffer.prototype.writeUInt16BE, 2);
+ SmartBuffer.prototype.writeUInt16LE = makeWriter(Buffer.prototype.writeUInt16LE, 2);
+ SmartBuffer.prototype.writeUInt32BE = makeWriter(Buffer.prototype.writeUInt32BE, 4);
+ SmartBuffer.prototype.writeUInt32LE = makeWriter(Buffer.prototype.writeUInt32LE, 4);
+
+ SmartBuffer.prototype.writeFloatBE = makeWriter(Buffer.prototype.writeFloatBE, 4);
+ SmartBuffer.prototype.writeFloatLE = makeWriter(Buffer.prototype.writeFloatLE, 4);
+
+ SmartBuffer.prototype.writeDoubleBE = makeWriter(Buffer.prototype.writeDoubleBE, 8);
+ SmartBuffer.prototype.writeDoubleLE = makeWriter(Buffer.prototype.writeDoubleLE, 8);
+
+
+ /**
+ * Writes a string to the underlying buffer.
+ * @param value {String} The string to write.
+ * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeString = function (value, offset, encoding) {
+ var len, _offset, type = typeof offset;
+
+ if (type === 'number') {
+ _offset = offset;
+ } else if (type === 'string') {
+ encoding = offset;
+ offset = this._writeOffset;
+ } else {
+ encoding = undefined;
+ offset = this._writeOffset;
+ }
+
+ len = Buffer.byteLength(value, encoding || this.encoding);
+ this._ensureWritable(len, _offset);
+
+ this.buff.write(value, offset, len, encoding || this.encoding);
+ this._writeOffset += len;
+ return this;
+ };
+
+ /**
+ * Writes a null terminated string to the underlying buffer.
+ * @param value {String} The string to write.
+ * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeStringNT = function (value, offset, encoding) {
+ this.writeString(value, offset, encoding);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
+ return this;
+ };
+
+ /**
+ * Writes a Buffer to the underlying buffer.
+ * @param value {Buffer} The buffer to write.
+ * @param offset {Number} The offset to write the Buffer to.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeBuffer = function (value, offset) {
+ var len = value.length;
+ this._ensureWritable(len, offset);
+ value.copy(this.buff, typeof offset === 'number' ? offset : this._writeOffset);
+ this._writeOffset += len;
+ return this;
+ };
+
+ /**
+ * Writes a null terminated Buffer to the underlying buffer.
+ * @param value {Buffer} The buffer to write.
+ * @param offset {Number} The offset to write the Buffer to.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeBufferNT = function (value, offset) {
+ this.writeBuffer(value, offset);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
+
+ return this;
+ };
+
+
+ /**
+ * Resets the Endless Buffer.
+ */
+ SmartBuffer.prototype.clear = function () {
+ this._writeOffset = 0;
+ this._readOffset = 0;
+ this.length = 0;
+ };
+
+ /**
+ * Gets the remaining number of bytes to be read from the existing Buffer.
+ * @returns {number} The number of bytes remaining.
+ */
+ SmartBuffer.prototype.remaining = function () {
+ return this.length - this._readOffset;
+ };
+
+ /**
+ * Skips the read position forward by the amount of given.
+ * @param amount {Number} The amount of bytes to skip forward.
+ */
+ SmartBuffer.prototype.skip = function (amount) {
+ if (this._readOffset + amount > this.length)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset += amount;
+ };
+
+ /**
+ * Rewinds the read position backward by the amount given.
+ * @param amount {Number} The amount of bytes to reverse backward.
+ */
+ SmartBuffer.prototype.rewind = function (amount) {
+ if (this._readOffset - amount < 0)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset -= amount;
+ };
+
+ /**
+ * Skips the read position to the given position.
+ * @param position {Number} The position to skip to.
+ */
+ SmartBuffer.prototype.skipTo = function (position) {
+ if (position < 0 || position > this.length)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset = position;
+ };
+
+ /**
+ * Gets the underlying Buffer.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.toBuffer = function () {
+ return this.buff.slice(0, this.length);
+ };
+
+ /**
+ * Gets a string representation of the underlying Buffer.
+ * @param encoding {String} Encoding to use. (Defaults to encoding set in constructor, or utf8.)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.toString = function (encoding) {
+ return this.buff.toString(encoding || this.encoding, 0, this.length);
+ };
+
+ /**
+ * Destroys the underlying Buffer, and resets the SmartBuffer.
+ */
+ SmartBuffer.prototype.destroy = function () {
+ delete this.buff;
+ this.clear();
+ };
+
+ return SmartBuffer;
+})();
+
+module.exports = SmartBuffer; \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json
new file mode 100644
index 0000000000..dd6cec4698
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json
@@ -0,0 +1,73 @@
+{
+ "_from": "smart-buffer@^1.0.13",
+ "_id": "smart-buffer@1.1.15",
+ "_integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks/smart-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "smart-buffer@^1.0.13",
+ "name": "smart-buffer",
+ "escapedName": "smart-buffer",
+ "rawSpec": "^1.0.13",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.13"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent/socks"
+ ],
+ "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
+ "_shasum": "7f114b5b65fab3e2a35aa775bb12f0d1c649bf16",
+ "_shrinkwrap": null,
+ "_spec": "smart-buffer@^1.0.13",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks",
+ "author": {
+ "name": "Josh Glazebrook"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/JoshGlazebrook/smart-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "A smarter Buffer that keeps track of its own read and write positions while growing endlessly.",
+ "devDependencies": {
+ "chai": "^3.5.0",
+ "coveralls": "^2.11.15",
+ "istanbul": "^0.4.3",
+ "mocha": "^3.2.0",
+ "mocha-lcov-reporter": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.10.15",
+ "npm": ">= 1.3.5"
+ },
+ "homepage": "https://github.com/JoshGlazebrook/smart-buffer/",
+ "keywords": [
+ "buffer",
+ "smart",
+ "serialize",
+ "packet",
+ "network",
+ "cursor",
+ "simple"
+ ],
+ "license": "MIT",
+ "main": "lib/smart-buffer.js",
+ "name": "smart-buffer",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/JoshGlazebrook/smart-buffer.git"
+ },
+ "scripts": {
+ "coverage": "istanbul cover node_modules/mocha/bin/_mocha recursive test",
+ "fullcoverage": "istanbul -include-all-sources cover node_modules/mocha/bin/_mocha recursive test",
+ "test": "mocha test/smart-buffer.test.js"
+ },
+ "typings": "typings/index",
+ "version": "1.1.15"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js
new file mode 100644
index 0000000000..0897d54c2f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js
@@ -0,0 +1,410 @@
+var SmartBuffer = require('../lib/smart-buffer.js');
+var assert = require('chai').assert;
+
+
+describe('Constructing a SmartBuffer', function () {
+ describe('Constructing with an existing Buffer', function () {
+ var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
+ var reader = new SmartBuffer(buff);
+
+ it('should have the exact same internal Buffer when constructed with a Buffer', function () {
+ assert.strictEqual(reader.buff, buff);
+ });
+
+ it('should return a buffer with the same content', function () {
+ assert.deepEqual(reader.toBuffer(), buff);
+ });
+ });
+
+ describe('Constructing with an existing Buffer and setting the encoding', function () {
+ var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
+ var reader = new SmartBuffer(buff, 'ascii');
+
+ it('should have the exact same internal Buffer', function () {
+ assert.strictEqual(reader.buff, buff);
+ });
+
+ it('should have the same encoding that was set', function () {
+ assert.strictEqual(reader.encoding, 'ascii');
+ });
+ });
+
+ describe('Constructing with a specified size', function () {
+ var size = 128;
+ var reader = new SmartBuffer(size);
+
+ it('should have an internal Buffer with the same length as the size defined in the constructor', function () {
+ assert.strictEqual(reader.buff.length, size);
+ });
+ });
+
+ describe('Constructing with a specified encoding', function () {
+ var encoding = 'utf8';
+
+ it('should have an internal encoding with the encoding given to the constructor (1st argument)', function () {
+ var reader = new SmartBuffer(encoding);
+ assert.strictEqual(reader.encoding, encoding);
+ });
+
+ it('should have an internal encoding with the encoding given to the constructor (2nd argument)', function () {
+ var reader = new SmartBuffer(1024, encoding);
+ assert.strictEqual(reader.encoding, encoding);
+ });
+
+ });
+
+ describe('Constructing with invalid parameters', function () {
+ it('should throw an exception when given an invalid number size', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer(-100);
+ }, Error);
+ });
+
+ it('should throw an exception when give a invalid encoding', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer('invalid');
+ }, Error);
+
+ assert.throws(function () {
+ var reader = new SmartBuffer(1024, 'invalid');
+ }, Error);
+ });
+
+ it('should throw and exception when given an object that is not a Buffer', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer(null);
+ }, TypeError);
+ });
+ });
+});
+
+
+describe('Reading/Writing To/From SmartBuffer', function () {
+ /**
+ * Technically, if one of these works, they all should. But they're all here anyways.
+ */
+
+ describe('Numeric Values', function () {
+ var reader = new SmartBuffer();
+ reader.writeInt8(0x44);
+ reader.writeUInt8(0xFF);
+ reader.writeInt16BE(0x6699);
+ reader.writeInt16LE(0x6699);
+ reader.writeUInt16BE(0xFFDD);
+ reader.writeUInt16LE(0xFFDD);
+ reader.writeInt32BE(0x77889900);
+ reader.writeInt32LE(0x77889900);
+ reader.writeUInt32BE(0xFFDDCCBB);
+ reader.writeUInt32LE(0xFFDDCCBB);
+ reader.writeFloatBE(1.234);
+ reader.writeFloatLE(1.234);
+ reader.writeDoubleBE(1.234567890);
+ reader.writeDoubleLE(1.234567890);
+
+ it('should equal the correct values that were written above', function () {
+ assert.strictEqual(reader.readInt8(), 0x44);
+ assert.strictEqual(reader.readUInt8(), 0xFF);
+ assert.strictEqual(reader.readInt16BE(), 0x6699);
+ assert.strictEqual(reader.readInt16LE(), 0x6699);
+ assert.strictEqual(reader.readUInt16BE(), 0xFFDD);
+ assert.strictEqual(reader.readUInt16LE(), 0xFFDD);
+ assert.strictEqual(reader.readInt32BE(), 0x77889900);
+ assert.strictEqual(reader.readInt32LE(), 0x77889900);
+ assert.strictEqual(reader.readUInt32BE(), 0xFFDDCCBB);
+ assert.strictEqual(reader.readUInt32LE(), 0xFFDDCCBB);
+ assert.closeTo(reader.readFloatBE(), 1.234, 0.001);
+ assert.closeTo(reader.readFloatLE(), 1.234, 0.001);
+ assert.closeTo(reader.readDoubleBE(), 1.234567890, 0.001);
+ assert.closeTo(reader.readDoubleLE(), 1.234567890, 0.001);
+ });
+
+ });
+
+ describe('Basic String Values', function () {
+ var reader = new SmartBuffer();
+ reader.writeStringNT('hello');
+ reader.writeString('world');
+ reader.writeStringNT('✎✏✎✏✎✏');
+
+ it('should equal the correct strings that were written above', function () {
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ assert.strictEqual(reader.readString(5), 'world');
+ assert.strictEqual(reader.readStringNT(), '✎✏✎✏✎✏');
+ });
+ });
+
+ describe('Mixed Encoding Strings', function () {
+ var reader = new SmartBuffer('ascii');
+ reader.writeStringNT('some ascii text');
+ reader.writeStringNT('ѕσмє υтƒ8 тєχт', 'utf8');
+
+ it('should equal the correct strings that were written above', function () {
+ assert.strictEqual(reader.readStringNT(), 'some ascii text');
+ assert.strictEqual(reader.readStringNT('utf8'), 'ѕσмє υтƒ8 тєχт');
+ });
+ });
+
+ describe('Null/non-null terminating strings', function () {
+ var reader = new SmartBuffer();
+ reader.writeString('hello\0test\0bleh');
+
+ it('should equal hello', function () {
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ });
+
+ it('should equal: test', function () {
+ assert.strictEqual(reader.readString(4), 'test');
+ });
+
+ it('should have a length of zero', function () {
+ assert.strictEqual(reader.readStringNT().length, 0);
+ });
+
+ it('should equal: bleh', function () {
+ assert.strictEqual(reader.readStringNT(), 'bleh');
+ });
+
+
+ });
+
+ describe('Reading string without specifying length', function () {
+ var str = 'hello123';
+ var writer = new SmartBuffer();
+ writer.writeString(str);
+
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.strictEqual(reader.readString(), str);
+ });
+
+ describe('Write string as specific position', function () {
+ var str = 'hello123';
+ var writer = new SmartBuffer();
+ writer.writeString(str, 10);
+
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ reader.skipTo(10);
+ it('Should read the correct string from the original position it was written to.', function () {
+ assert.strictEqual(reader.readString(), str);
+ });
+
+
+ });
+
+ describe('Buffer Values', function () {
+ describe('Writing buffer to position 0', function () {
+ var buff = new SmartBuffer();
+ var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
+ buff.writeStringNT('hello');
+ buff.writeBuffer(frontBuff, 0);
+
+ it('should write the buffer to the front of the smart buffer instance', function () {
+ var readBuff = buff.readBuffer(frontBuff.length);
+ assert.deepEqual(readBuff, frontBuff);
+ });
+ });
+
+ describe('Writing null terminated buffer to position 0', function () {
+ var buff = new SmartBuffer();
+ var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
+ buff.writeStringNT('hello');
+ buff.writeBufferNT(frontBuff, 0);
+
+ console.log(buff);
+
+ it('should write the buffer to the front of the smart buffer instance', function () {
+ var readBuff = buff.readBufferNT();
+ console.log(readBuff);
+ assert.deepEqual(readBuff, frontBuff);
+ });
+ });
+
+ describe('Explicit lengths', function () {
+ var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
+ var reader = new SmartBuffer();
+ reader.writeBuffer(buff);
+
+ it('should equal the buffer that was written above.', function () {
+ assert.deepEqual(reader.readBuffer(7), buff);
+ });
+ });
+
+ describe('Implicit lengths', function () {
+ var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
+ var reader = new SmartBuffer();
+ reader.writeBuffer(buff);
+
+ it('should equal the buffer that was written above.', function () {
+ assert.deepEqual(reader.readBuffer(), buff);
+ });
+ });
+
+ describe('Null Terminated Buffer Reading', function () {
+ var buff = new SmartBuffer();
+ buff.writeBuffer(new Buffer([0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03]));
+
+ var read1 = buff.readBufferNT();
+ var read2 = buff.readBufferNT();
+
+ it('Should return a length of 4 for the four bytes before the first null in the buffer.', function () {
+ assert.equal(read1.length, 4);
+ });
+
+ it('Should return a length of 3 for the three bytes after the first null in the buffer after reading to end.', function () {
+ assert.equal(read2.length, 3);
+ });
+ });
+
+ describe('Null Terminated Buffer Writing', function () {
+ var buff = new SmartBuffer();
+ buff.writeBufferNT(new Buffer([0x01, 0x02, 0x03, 0x04]));
+
+ var read1 = buff.readBufferNT();
+
+ it('Should read the correct null terminated buffer data.', function () {
+ assert.equal(read1.length, 4);
+ });
+
+ })
+
+ });
+
+ describe('Inserting values into specific positions', function () {
+ var reader = new SmartBuffer();
+
+ reader.writeUInt16LE(0x0060);
+ reader.writeStringNT('something');
+ reader.writeUInt32LE(8485934);
+ reader.writeUInt16LE(6699);
+ reader.writeStringNT('else');
+ reader.writeUInt16LE(reader.length - 2, 2);
+
+
+ it('should equal the size of the remaining data in the buffer', function () {
+ reader.readUInt16LE();
+ var size = reader.readUInt16LE();
+ assert.strictEqual(reader.remaining(), size);
+ });
+ });
+
+ describe('Adding more data to the buffer than the internal buffer currently allows.', function () {
+ it('Should automatically adjust internal buffer size when needed', function () {
+ var writer = new SmartBuffer();
+ var largeBuff = new Buffer(10000);
+
+ writer.writeBuffer(largeBuff);
+
+ assert.strictEqual(writer.length, largeBuff.length);
+ });
+ });
+
+});
+
+describe('Skipping around data', function () {
+ var writer = new SmartBuffer();
+ writer.writeStringNT('hello');
+ writer.writeUInt16LE(6699);
+ writer.writeStringNT('world!');
+
+ it('Should equal the UInt16 that was written above', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+ reader.skip(6);
+ assert.strictEqual(reader.readUInt16LE(), 6699);
+ reader.skipTo(0);
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ reader.rewind(6);
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ });
+
+ it('Should throw an error when attempting to skip more bytes than actually exist.', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.throws(function () {
+ reader.skip(10000);
+ });
+ });
+
+ it('Should throw an error when attempting to skip to a position that does not exist.', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.throws(function () {
+ reader.skipTo(10000);
+ });
+ });
+
+ it('Should throw an error when attempting to rewind past the start of the buffer.', function () {
+ var buff = new SmartBuffer();
+ assert.throws(function () {
+ buff.rewind(10000);
+ });
+ });
+});
+
+describe('Automatic internal buffer resizing', function () {
+ var writer;
+
+ it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo fails)', function () {
+ var str = 'String larger than one byte';
+ writer = new SmartBuffer(1);
+ writer.writeString(str);
+
+ assert.strictEqual(writer.buff.length, str.length);
+
+ });
+
+ it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo succeeds)', function () {
+ writer = new SmartBuffer(100);
+ var buff = new Buffer(105);
+
+ writer.writeBuffer(buff);
+
+ // Test internal array growth algo.
+ assert.strictEqual(writer.buff.length, (100 * 3 / 2 + 1));
+ });
+});
+
+describe('Clearing the buffer', function () {
+ var writer = new SmartBuffer();
+ writer.writeString('somedata');
+
+ it('Should contain some data.', function () {
+ assert.notStrictEqual(writer.length, 0);
+ });
+
+ it('Should contain zero data after being cleared.', function () {
+ writer.clear();
+ assert.strictEqual(writer.length, 0);
+ });
+});
+
+describe('Displaying the buffer as a string', function () {
+ var buff = new Buffer([1, 2, 3, 4]);
+ var sbuff = new SmartBuffer(buff);
+
+ var str = buff.toString();
+ var str64 = buff.toString('base64');
+
+ it('Should return a valid string representing the internal buffer', function () {
+ assert.strictEqual(str, sbuff.toString());
+ });
+
+ it('Should return a valid base64 string representing the internal buffer', function () {
+ assert.strictEqual(str64, sbuff.toString('base64'));
+ });
+});
+
+describe('Destroying the buffer', function () {
+ var writer = new SmartBuffer();
+ writer.writeString('hello123');
+
+ writer.destroy();
+
+ it('Should have a length of zero when buffer is destroyed', function () {
+ assert.strictEqual(0, writer.length);
+ });
+
+ it('Should have no internal buff property when buffer is destroyed', function () {
+ assert.notProperty(writer, 'buff');
+ });
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts
new file mode 100644
index 0000000000..b567f1e97c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts
@@ -0,0 +1,383 @@
+// Type definitions for smart-buffer
+// Project: https://github.com/JoshGlazebrook/smart-buffer
+// Definitions by: Josh Glazebrook <https://github.com/JoshGlazebrook>
+
+
+
+declare class SmartBuffer {
+ /**
+ * Creates a new SmartBuffer instance (defaults to utf8 encoding)
+ */
+ constructor();
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { Number } The size the underlying buffer instance should be instantiated to (defaults to 4096)
+ * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(size: number, encoding?: string);
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(encoding?: string);
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { Buffer } An existing buffer instance to copy to this smart buffer instance
+ * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(buffer: Buffer, encoding?: string)
+
+
+
+ // Signed number readers
+
+ /**
+ * Reads a 8-bit signed integer
+ */
+ readInt8(): number;
+
+ /**
+ * Reads a 16-bit signed integer (big endian)
+ */
+ readInt16BE(): number;
+
+ /**
+ * Reads a 16-bit signed integer (little endian)
+ */
+ readInt16LE(): number;
+
+ /**
+ * Reads a 32-bit signed integer (big endian)
+ */
+ readInt32BE(): number;
+
+ /**
+ * Reads a 32-bit signed integer (little endian)
+ */
+ readInt32LE(): number;
+
+ // Unsigned number readers
+
+ /**
+ * Reads a 8-bit unsigned integer
+ */
+ readUInt8(): number;
+
+ /**
+ * Reads a 16-bit unsigned integer (big endian)
+ */
+ readUInt16BE(): number;
+
+ /**
+ * Reads a 16-bit unsigned integer (little endian)
+ */
+ readUInt16LE(): number;
+
+ /**
+ * Reads a 32-bit unsigned integer (big endian)
+ */
+ readUInt32BE(): number;
+
+ /**
+ * Reads a 32-bit unsigned integer (little endian)
+ */
+ readUInt32LE(): number;
+
+ // Floating point readers
+
+ /**
+ * Reads a float (big endian)
+ */
+ readFloatBE(): number;
+
+ /**
+ * Reads a float (little endian)
+ */
+ readFloatLE(): number;
+
+ /**
+ * Reads a double (big endian)
+ */
+ readDoubleBE(): number;
+
+ /**
+ * Reads a double (little endian)
+ */
+ readDoubleLE(): number;
+
+ // String readers
+
+ /**
+ * Reads a string
+ *
+ * @param length { Number } The length of the string to read
+ * @param encoding { Number} The encoding to use (defaults to instance level encoding)
+ */
+ readString(length?: number, encoding?: string): string;
+
+ /**
+ * Reads a null terminated string
+ *
+ * @param encoding The encoding to use (defaults to instance level encoding)
+ */
+ readStringNT(encoding?: string): string;
+
+ // Buffer readers
+
+ /**
+ * Reads binary data into a Buffer
+ *
+ * @param len { Number } The amount of data to read
+ */
+ readBuffer(len?: number): Buffer;
+
+ /**
+ * Reads null terminated binary data into a Buffer
+ */
+ readBufferNT(): Buffer;
+
+
+ // Signed number writers
+
+ /**
+ * Writes a 8-bit signed integer value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt8(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit signed integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt16BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit signed integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt16LE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit signed integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt32BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit signed integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt32LE(value: number, offset?: number): this;
+
+ // Unsigned number writers
+
+ /**
+ * Writes a 8-bit unsigned integer value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt8(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit unsigned integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt16BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit unsigned integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt16LE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit unsigned integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt32BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit unsigned integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt32LE(value: number, offset?: number): this;
+
+ // Floating point writers
+
+ /**
+ * Writes a float (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeFloatBE(value: number, offset?: number): this;
+
+ /**
+ * Writes a float (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeFloatLE(value: number, offset?: number): this;
+
+ /**
+ * Writes a double (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeDoubleBE(value: number, offset?: number): this;
+
+ /**
+ * Writes a double (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeDoubleLE(value: number, offset?: number): this;
+
+ // String writers
+
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ writeString(value: string, offset?: number | string, encoding?: string): this;
+
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ writeStringNT(value: string, offset?: number | string, encoding?: string): this;
+
+ // Buffer writers
+
+ /**
+ * Writes a Buffer
+ *
+ * @param value { Buffer } The Buffer to write to the smart buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeBuffer(value: Buffer, offset?: number): this;
+
+ /**
+ * Writes a Buffer with null termination
+ *
+ * @param value { Buffer } The buffer to write to the smart buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeBufferNT(value: Buffer, offset?: number): this;
+
+
+ // Misc Functions
+
+ /**
+ * Clears the smart buffer
+ */
+ clear();
+
+ /**
+ * Gets the number of bytes that remain to be read
+ */
+ remaining(): number;
+
+ /**
+ * Increases the read offset position
+ *
+ * @param amount { Number } The amount to increase the read offset position by
+ */
+ skip(amount: number);
+
+ /**
+ * Changes the read offset position
+ *
+ * @param position { Number } The position to change the read offset to
+ */
+ skipTo(position: number);
+
+ /**
+ * Decreases the read offset position
+ *
+ * @param amount { Number } The amount to decrease the read offset position by
+ */
+ rewind(amount: number);
+
+ /**
+ * Gets the underlying Buffer instance
+ */
+ toBuffer(): Buffer;
+
+ /**
+ * Gets the string representation of the underlying Buffer
+ *
+ * @param encoding { String } The encoding to use (defaults to instance level encoding)
+ */
+ toString(encoding?: string): string;
+
+ /**
+ * Destroys the smart buffer instance
+ */
+ destroy();
+
+ /**
+ * Gets the current length of the smart buffer instance
+ */
+ length: number;
+}
+
+export = SmartBuffer; \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json
new file mode 100644
index 0000000000..a4ccc56333
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json
@@ -0,0 +1,72 @@
+{
+ "_from": "socks@~1.1.5",
+ "_id": "socks@1.1.10",
+ "_integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "socks@~1.1.5",
+ "name": "socks",
+ "escapedName": "socks",
+ "rawSpec": "~1.1.5",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.5"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent"
+ ],
+ "_resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz",
+ "_shasum": "5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a",
+ "_shrinkwrap": null,
+ "_spec": "socks@~1.1.5",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent",
+ "author": {
+ "name": "Josh Glazebrook"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/JoshGlazebrook/socks/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Samuel Gordalina"
+ }
+ ],
+ "dependencies": {
+ "ip": "^1.1.4",
+ "smart-buffer": "^1.0.13"
+ },
+ "deprecated": false,
+ "description": "A SOCKS proxy client supporting SOCKS 4, 4a, and 5. (also supports BIND/Associate)",
+ "devDependencies": {},
+ "engines": {
+ "node": ">= 0.10.0",
+ "npm": ">= 1.3.5"
+ },
+ "homepage": "https://github.com/JoshGlazebrook/socks",
+ "keywords": [
+ "socks",
+ "proxy",
+ "client",
+ "tor",
+ "bind",
+ "associate",
+ "socks 4",
+ "socks 4a",
+ "socks 5",
+ "agent"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "socks",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/JoshGlazebrook/socks.git"
+ },
+ "version": "1.1.10"
+}