diff --git a/src/mw/BasicAuth.hx b/src/mw/BasicAuth.hx index 5a36854..8267c8f 100644 --- a/src/mw/BasicAuth.hx +++ b/src/mw/BasicAuth.hx @@ -22,7 +22,7 @@ class BasicAuth { return; } - var authorizationHeader = req.headers["authorization"]; + var authorizationHeader : String = req.headers.get(AUTHORIZATION); if (authorizationHeader == null || authorizationHeader.trim() == "") { send401(res, realm); return; @@ -74,7 +74,7 @@ class BasicAuth { } static function send401(res : Response, realm : String) : Void { - res.setHeader('WWW-Authenticate', '$BASIC $REALM="$realm"'); + res.setHeader(WWW_AUTHENTICATE, '$BASIC $REALM="$realm"'); res.status(401).end(); } diff --git a/xml/js.xml b/xml/js.xml index ee3b2b2..a2f7afc 100644 --- a/xml/js.xml +++ b/xml/js.xml @@ -2596,7 +2596,7 @@ - + @@ -2639,7 +2639,7 @@ See `EventEmitter` for actual class documentation. - + `setMaxListeners` sets the maximum on a per-instance basis. @@ -2743,19 +2743,19 @@ "EventEmitter" - + `IStream` interface is used as "any Stream". See `Stream` for actual class. - + Base class for all streams. "stream" - + @@ -2803,7 +2803,7 @@ See `Readable` for actual class documentation. - + @@ -2973,7 +2973,7 @@ "Readable" - + @@ -3111,7 +3111,7 @@ - + @@ -3161,7 +3161,7 @@ See `Writable` for actual class documentation. - + @@ -3305,7 +3305,7 @@ "Writable" - + @@ -5658,2252 +5658,1977 @@ This can be used to track positions of calls in e.g. a unit testing framework. - - + + + + How many bytes will be returned when `buffer.inspect()` is called. + This can be overridden by user modules. + Default: 50 + + + - - - - - - - - - - + + + + + + - - - - - - + Returns `true` if the encoding is a valid encoding argument, or `false` otherwise. + + + + + + + Tests if `obj` is a `Buffer`. + + + + + - - Read the most efficiently possible the n-th byte of the data. - Behavior when reading outside of the available data is unspecified. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Gives the actual byte length of a string. + + `encoding` defaults to 'utf8'. + + This is not the same as `String.length` since that + returns the number of characters in a string. + + + + - + - Returns the IEEE double precision value at given position (in low endian encoding). - Result is unspecified if reading outside of the bounds - - - + Returns a buffer which is the result of concatenating all the buffers in the `list` together. + + If the `list` has no items, or if the `totalLength` is 0, then it returns a zero-length buffer. + If the `list` has exactly one item, then the first item of the `list` is returned. + If the `list` has more than one item, then a new `Buffer` is created. + + If `totalLength` is not provided, it is read from the buffers in the `list`. + However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + + + + + - - Returns the IEEE single precision value at given position (in low endian encoding). - Result is unspecified if reading outside of the bounds - - - + "compare" + The same as `buf1.compare(buf2)`. Useful for sorting an Array of Buffers. + + + + The size of the buffer in bytes. + + Note that this is not necessarily the size of the contents. + `length` refers to the amount of memory allocated for the buffer object. + It does not change when the contents of the buffer are changed. + + + + Returns a JSON-representation of the `Buffer` instance. + + + + + - - - Store the IEEE double precision value at given position in low endian encoding. - Result is unspecified if writing outside of the bounds. - - - + Writes `string` to the buffer at `offset` using the given `encoding`. + + `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. + + Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, + it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. + + The method will not write partial characters. + + + + + + + + + + Writes `string` to the buffer at `offset` using the given `encoding`. + + `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. + + Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, + it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. + + The method will not write partial characters. + + + + + + + + + Writes `string` to the buffer at `offset` using the given `encoding`. + + `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. + + Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, + it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. + + The method will not write partial characters. + + + + + + Decodes and returns a string from buffer data encoded with `encoding` (defaults to 'utf8') + beginning at `start` (defaults to 0) and ending at `end` (defaults to `buffer.length`). + + + + + + + + Decodes and returns a string from buffer data encoded with `encoding` (defaults to 'utf8') + beginning at `start` (defaults to 0) and ending at `end` (defaults to `buffer.length`). + + + + + + + - - Store the IEEE single precision value at given position in low endian encoding. - Result is unspecified if writing outside of the bounds. - - - + Does copy between buffers. + The source and target regions can be overlapped. + `targetStart` and `sourceStart` default to 0. `sourceEnd` defaults to `buffer.length`. + + + + - Returns the 16 bit unsigned integer at given position (in low endian encoding). - - - + Returns a new buffer which references the same memory as the old, + but offset and cropped by the `start` (defaults to 0) and `end` (defaults to `buffer.length`) indexes. + Negative indexes start from the end of the buffer. + + Modifying the new buffer slice will modify memory in the original buffer! + + + + - - Store the 16 bit unsigned integer at given position (in low endian encoding). - - - + Reads an unsigned 8 bit integer from the buffer at the specified offset. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + - Returns the 32 bit integer at given position (in low endian encoding). - - - + Reads an unsigned 16 bit integer from the buffer at the specified `offset` with little-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + - - Store the 32 bit integer at given position (in low endian encoding). - - - + Reads an unsigned 16 bit integer from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + - - - Returns the 64 bit integer at given position (in low endian encoding). - - - + - - - Store the 64 bit integer at given position (in low endian encoding). - - - - - - - - + Reads an unsigned 32 bit integer from the buffer at the specified `offset` with little-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + - - - - "readString is deprecated, use getString instead" - - - - - - - - - - - - - - - - - - - - - - "ArrayBufferView" - - - - - - 1 - - - - - - - - - + Reads an unsigned 32 bit integer from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + + - - - - - - - - - - - - - - - - - - - - - - + Reads a signed 8 bit integer from the buffer at the specified `offset`. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + Works as `readUInt8`, except buffer contents are treated as two's complement signed values. + + + + - - @throws DOMError - - - - - - - @throws DOMError - - - - - - - @throws DOMError - - - - - - - @throws DOMError - - - - "Uint8Array" - - - - - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - - - - haxe.io.Bytes.ofString(CHARS) - - - - + Reads a signed 16 bit integer from the buffer at the specified `offset` with little-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + Works as `readUInt16LE`, except buffer contents are treated as two's complement signed values. + + + + - + - { complement : true } - - - - + Reads a signed 16 bit integer from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + Works as `readUInt16BE`, except buffer contents are treated as two's complement signed values. + + + + - + - { complement : true } - - Allows to encode/decode String and bytes using Base64 encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Allows to encode/decode String and bytes using a power of two base dictionary. - - - - - - - - - - - - An abstract type allowing values to be either of `T1` or `T2` type. - Supports implicit casts from/to either types. - - It is useful for interfacing with external code on dynamic platforms - such as JavaScript or Python. + Reads a signed 32 bit integer from the buffer at the specified `offset` with little-endian format. - Otherwise, use of this type is discouraged. - - - - - - A special abstract type that represents "rest" function argument. + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - Should be used as a type for the last argument of an extern method, - representing that arbitrary number of arguments of given type can be - passed to that method. - - - - - - The IO is set into nonblocking mode and some data cannot be read or written - An integer value is outside its allowed range - An operation on Bytes is outside of its valid range - - - Other errors - - The possible IO errors that can occur - - - - - - - - - - - - - - - + Works as `readUInt32LE`, except buffer contents are treated as two's complement signed values. + + + + + + - - - - - <__unhtml set="method" line="43" static="1"> - - - - <__trace set="method" line="47" static="1"> - - - - - - - - - <__enum__ set="null"> - - - + Reads a signed 32 bit integer from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + Works as `readUInt32BE`, except buffer contents are treated as two's complement signed values. + + + + + + - - - <__clear_trace set="method" line="67" static="1"> - - - - - - + Reads a 32 bit float from the buffer at the specified `offset` with little-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + + - - - - - + Reads a 32 bit float from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + + - - - - - - - - - - <__string_rec set="method" line="102" static="1"> - - - - - - - - - <__enum__ set="null"> - - - - - - - "has_enum" - - - <__interfLoop set="method" line="174" static="1"> - - - - - <__instanceof set="method" line="189" static="1"> - - - + Reads a 64 bit double from the buffer at the specified `offset` with little-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + + - - - "typed_catch" - - - <__cast set="method" line="228" static="1"> - - - - + Reads a 64 bit double from the buffer at the specified `offset` with big-endian format. + + Set `noAssert` to `true` to skip validation of `offset`. + This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + + + + + + + - "typed_cast" - - <__toStr expr="untyped ({ }).toString" line="233" static="1"> - - - - - - - - - - - untyped ({ }).toString - - - <__nativeClassName set="method" line="235" static="1"> - - - + Writes `value` to the buffer at the specified `offset`. + Note, `value` must be a valid unsigned 8 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + + - - - <__isNativeObj set="method" line="245" static="1"> - - - - <__resolveNativeClass set="method" line="250" static="1"> - - - + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, `value` must be a valid unsigned 16 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + + - - - hide - - - - - - - - "EvalError" - - - - - - - - "RangeError" - - - - - - - - "ReferenceError" - - - - - - - - "SyntaxError" - - - - - - - - "TypeError" - - - - - - - - "URIError" - - - - - - Inserts a 'debugger' statement that will make a breakpoint if a debugger is available. - - - - + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, `value` must be a valid unsigned 16 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + - - - "Lib.alert() is deprecated, use Browser.alert() instead" - - Display an alert message box containing the given message. - @deprecated Use Browser.alert() instead. - - - - - + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, `value` must be a valid unsigned 32 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + + - - - - - - + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, `value` must be a valid unsigned 32 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + + - - - - - Inserts a `require` expression that loads JavaScript object from - a module or file specified in the `module` argument. + Writes `value` to the buffer at the specified `offset`. + Note, `value` must be a valid signed 8 bit integer. - This is only supported in environments where `require` function - is available, such as Node.js or RequireJS. - - - - Returns JavaScript `undefined` value. + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. - Note that this is only needed in very rare cases when working with external JavaScript code. + Works as `writeUInt8`, except `value` is written out as a two's complement signed integer into buffer. + + + + + + + + + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, value must be a valid signed 16 bit integer. - In Haxe, `null` is used to represent the absence of a value. - - - - - - - - `nativeThis` is the JavaScript `this`, which is semantically different - from the Haxe `this`. Use `nativeThis` only when working with external - JavaScript code. + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. - In Haxe, `this` is always bound to a class instance. - In JavaScript, `this` in a function can be bound to an arbitrary - variable when the function is called using `func.call(thisObj, ...)` or - `func.apply(thisObj, [...])`. + Works as `writeUInt16LE`, except `value` is written out as a two's complement signed integer into buffer. + + + + + + + + + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, value must be a valid signed 16 bit integer. - Read more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this - - - - - - - - - - - An alias of the JS "global" object. + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. - Concretely, it is set as the first defined value in the list of - `window`, `global`, `self`, and `this` in the top-level of the compiled output. - - - - - - - - - - - - - - - Re-throw last cathed exception, preserving original stack information. + Works as `writeUInt16BE`, except `value` is written out as a two's complement signed integer into buffer. + + + + + + + + + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, value must be a valid signed 32 bit integer. - Calling this only makes sense inside a catch statement. - - Platform-specific JavaScript Library. Provides some platform-specific functions - for the JavaScript target. - - - - - - - - - - - - - - - - - - - + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + Works as `writeUInt32LE`, except `value` is written out as a two's complement signed integer into buffer. + + + + + - @throws DOMError - - "ArrayBuffer" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, value must be a valid signed 32 bit integer. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + Works as `writeUInt32BE`, except `value` is written out as a two's complement signed integer into buffer. + + + + + + + + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, behavior is unspecified if `value` is not a 32 bit float. + + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + - @throws DOMError - - "DataView" - - - - - - - Enumeration of possible Int `options` values for `Dns.lookup`. - - - - - - cast 4 - - - - - - - - cast 6 - - - - - - - - - - - - cast 4 - - - - - - - - cast 6 - - - - - - - - - - - - If present, it should be one or more of the supported `getaddrinfo` flags. - If hints is not provided, then no flags are passed to `getaddrinfo`. - Multiple flags can be passed through hints by logically ORing their values. - - - - - The record family. If not provided, both IP v4 and v6 addresses are accepted. - - - - - When true, the callback returns all resolved addresses in an array, otherwise returns a single address. - Defaults to false. - - - Type of the `options` argument for `Dns.lookup`. - - - - - - Enumeration of possible `rrtype` value for `Dns.resolve`. - - - - - - cast "A" - - - - IPV4 addresses, default - - - - - cast "AAAA" - - - - IPV6 addresses - - - - - cast "MX" - - - - mail exchange records - - - - - cast "TXT" - - - - text records - - - - - cast "SRV" - - - - SRV records - - - - - cast "PTR" - - - - used for reverse IP lookups - - - - - cast "NS" - - - - name server records - - - - - cast "CNAME" - - - - canonical name records - - - - - cast "SOA" - - - - start of authority record - - - - - - - - - cast "A" - - - - IPV4 addresses, default - - - - - cast "AAAA" - - - - IPV6 addresses - - - - - cast "MX" - - - - mail exchange records - - - - - cast "TXT" - - - - text records - - - - - cast "SRV" - - - - SRV records - - - - - cast "PTR" - - - - used for reverse IP lookups - - - - - cast "NS" - - - - name server records - - - - - cast "CNAME" - - - - canonical name records - - - - - cast "SOA" - - - - start of authority record - - - - - - - - - Types of address data returned by `resolve` functions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Values for error codes are listed in `Dns` class. - - Error objects returned by dns lookups are of this type - - - DNS server returned answer with no data. - DNS server claims query was misformatted. - DNS server returned general failure. - Domain name not found. - DNS server does not implement requested operation. - DNS server refused query. - Misformatted DNS query. - Misformatted domain name. - Unsupported address family. - Misformatted DNS reply. - Could not contact DNS servers. - Timeout while contacting DNS servers. - End of file. - Error reading file. - Out of memory. - Channel is being destroyed. - Misformatted string. - Illegal flags specified. - Given hostname is not numeric. - Illegal hints flags specified. - c-ares library initialization not yet performed. - Error loading iphlpapi.dll. - Could not find GetNetworkParams function. - DNS query cancelled. - Each DNS query can return one of the following error codes - - - String - "dns" - - - - - - - - - - - - - - - -
-
- - - - - - - - Resolves a `hostname` (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. - - If `options` is not provided, then IP v4 and v6 addresses are both valid. - - The `family` can be the integer 4 or 6. Defaults to null that indicates both Ip v4 and v6 address family. - - The `callback` has arguments (err, address, family). - The `address` argument is a string representation of a IP v4 or v6 address. - The `family` argument is either the integer 4 or 6 and denotes the family - of address (not necessarily the value initially passed to lookup). - - With the `all` option set, the arguments change to (err, addresses), with addresses being an array of objects - with the properties `address` and `family`. - - Keep in mind that `err.code` will be set to 'ENOENT' not only when the hostname does not exist but - also when the lookup fails in other ways such as no available file descriptors. - - `lookup` doesn't necessarily have anything to do with the DNS protocol. It's only an operating system facility - that can associate name with addresses, and vice versa. - - - - - - - - - - - - - - Resolves a `hostname` (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. - - If `options` is not provided, then IP v4 and v6 addresses are both valid. - - The `family` can be the integer 4 or 6. Defaults to null that indicates both Ip v4 and v6 address family. - - The `callback` has arguments (err, address, family). - The `address` argument is a string representation of a IP v4 or v6 address. - The `family` argument is either the integer 4 or 6 and denotes the family - of address (not necessarily the value initially passed to lookup). - - With the `all` option set, the arguments change to (err, addresses), with addresses being an array of objects - with the properties `address` and `family`. - - Keep in mind that `err.code` will be set to 'ENOENT' not only when the hostname does not exist but - also when the lookup fails in other ways such as no available file descriptors. - - `lookup` doesn't necessarily have anything to do with the DNS protocol. It's only an operating system facility - that can associate name with addresses, and vice versa. - - - - - A flag passed in the `hints` argument of `lookup` method. - - Returned address types are determined by the types of addresses supported by the current system. - For example, IPv4 addresses are only returned if the current system has at least one IPv4 address configured. - Loopback addresses are not considered. - - - - A flag passed in the `hints` argument of `lookup` method. + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, behavior is unspecified if `value` is not a 32 bit float. - If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. - Note that it is not supported on some operating systems (e.g FreeBSD 10.1). - - - - + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + - - - - - - - - - Resolves the given `address` and `port` into a hostname and service using `getnameinfo`. - - The `callback` has arguments (err, hostname, service). - The `hostname` and `service` arguments are strings (e.g. 'localhost' and 'http' respectively). - - On error, `err` is an Error object, where `err.code` is the error code. - - - - - - - - - - - - - Resolves a `hostname` (e.g. 'google.com') into an array of the record types specified by `rrtype`. - - The `callback` has arguments (err, addresses). - The type of each item in `addresses` is determined by the record type, - and described in the documentation for the corresponding lookup methods below. - - On error, `err` is an Error object, where `err.code` is the error code. - - - - - - - - - - - Resolves a `hostname` (e.g. 'google.com') into an array of the record types specified by `rrtype`. - - The `callback` has arguments (err, addresses). - The type of each item in `addresses` is determined by the record type, - and described in the documentation for the corresponding lookup methods below. - - On error, `err` is an Error object, where `err.code` is the error code. - - - - - - - - - - - - - The same as `resolve`, but only for IPv4 queries (A records). - `addresses` is an array of IPv4 addresses (e.g. ['74.125.79.104', '74.125.79.105', '74.125.79.106']). - - - - - - - - - - - - The same as `resolve4` except for IPv6 queries (an AAAA query). - - - - - - - - - - - - The same as `resolve`, but only for mail exchange queries (MX records). - `addresses` is an array of MX records, each with a priority - and an exchange attribute (e.g. [{'priority': 10, 'exchange': 'mx.example.com'},...]). - - - - - - - - - - - - The same as `resolve`, but only for text queries (TXT records). - `addresses` is a 2-d array of the text records available for hostname (e.g., [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]). - Each sub-array contains TXT chunks of one record. Depending on the use case, the could be either joined together - or treated separately. - - - - - - - - - - - - The same as `resolve`, but only for service records (SRV records). - `addresses` is an array of the SRV records available for `hostname`. - Properties of SRV records are priority, weight, port, and name - (e.g., [{'priority': 10, 'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]). - - - - - - - - - + - The same as `resolve`, but only for start of authority record queries (SOA record). + Writes `value` to the buffer at the specified `offset` with little-endian format. + Note, `value` must be a valid 64 bit double. - `addresses` is an object with the following structure: - { - nsname: 'ns.example.com', - hostmaster: 'root.example.com', - serial: 2013101809, - refresh: 10000, - retry: 2400, - expire: 604800, - minttl: 3600 - } - - - - - - - - - - - - The same as `resolve`, but only for name server records (NS records). - `addresses` is an array of the name server records available for hostname (e.g., ['ns1.example.com', 'ns2.example.com']). - - - - - - - - - - - - The same as `resolve`, but only for canonical name records (CNAME records). - `addresses` is an array of the canonical name records available for hostname (e.g., ['bar.example.com']). - - - - - - - - - - - - Reverse resolves an `ip` address to an array of hostnames. - The `callback` has arguments (err, hostname). - - - - Returns an array of IP addresses as strings that are currently being used for resolution. - - - - + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + + + + - Given an array of IP addresses as strings, set them as the servers to use for resolving. - - If you specify a port with the address it will be stripped, as the underlying library doesn't support that. - - This will throw if you pass invalid input. - - This module contains functions that belong to two different categories: - - 1) Functions that use the underlying operating system facilities to perform name resolution, - and that do not necessarily do any network communication. This category contains only one function: `lookup`. - Developers looking to perform name resolution in the same way that other applications on the same operating - system behave should use `lookup`. + Writes `value` to the buffer at the specified `offset` with big-endian format. + Note, `value` must be a valid 64 bit double. - 2) Functions that connect to an actual DNS server to perform name resolution, - and that always use the network to perform DNS queries. This category contains all functions in the dns module but `lookup`. - These functions do not use the same set of configuration files than what `lookup` uses. For instance, - they do not use the configuration from /etc/hosts. These functions should be used by developers who do not want - to use the underlying operating system's facilities for name resolution, and instead want to always perform DNS queries. - "dns" - - - - - - - - - - Object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq - - - - - - CPUTime data. - - + Set `noAssert` to `true` to skip validation of `value` and `offset`. + This means that `value` may be too large for the specific function + and `offset` may be beyond the end of the buffer leading to the values + being silently dropped. This should not be used unless you are certain + of correctness. Defaults to `false`. + + + - MHz Speed - - - - CPU Model. E.g. 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz' - - - Object containing information about each CPU/core installed: model, speed (in MHz), and times - - - - Objects containing information about network interface addresses. - - - - - Whether this address is internal. - - - - IP address family (e.g. IPv4, IPv6). - -
+ + + + + Fills the buffer with the specified `value`. + If the `offset` (defaults to 0) and `end` (defaults to `buffer.length`) + are not given it will fill the entire buffer. + + - IP address (format depends on family). -
-
- - - - - - - - - cast "BE" - - - - - - - - cast "LE" - - - - - - - - - - - - cast "BE" - - - - - - - - cast "LE" - - - - - - - - - - A constant defining the appropriate End-of-line marker for the operating system. - - - - Returns the operating system's default directory for temp files. - - - - Returns the endianness of the CPU. Possible values are "BE" or "LE". - - - - Returns the hostname of the operating system. - - - - Returns the operating system name. - - - - Returns the operating system platform. - - - - Returns the operating system CPU architecture. - - - - Returns the operating system release. - - - - Returns the system uptime in seconds. - - - - Returns an array containing the 1, 5, and 15 minute load averages. - - The load average is a measure of system activity, calculated by the operating system and expressed as a fractional number. - As a rule of thumb, the load average should ideally be less than the number of logical CPUs in the system. + + + + + Fills the buffer with the specified `value`. + If the `offset` (defaults to 0) and `end` (defaults to `buffer.length`) + are not given it will fill the entire buffer. + + + + + + + + Returns a boolean of whether `this` and `otherBuffer` have the same bytes. + + + + + + + Returns a number indicating whether `this` comes before or after or is the same as the `otherBuffer` in sort order. + + + + + + + + Operates similar to `Array.indexOf`. + + Accepts a String, Buffer or Int. + Strings are interpreted as UTF8. + Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. + Int can range from 0 to 255. + + + + + + + + Operates similar to `Array.indexOf`. + + Accepts a String, Buffer or Int. + Strings are interpreted as UTF8. + Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. + Int can range from 0 to 255. + + + + + + + + Operates similar to `Array.indexOf`. + + Accepts a String, Buffer or Int. + Strings are interpreted as UTF8. + Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. + Int can range from 0 to 255. + + + + + + + + + Allocates a new buffer. + + + + + + + + Allocates a new buffer. + + + + + + + Allocates a new buffer. + + + + + + + Allocates a new buffer. + + + + The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways. - The load average is a very UNIX-y concept; there is no real equivalent on Windows platforms. - That is why this function always returns [0, 0, 0] on Windows. - - - - Returns the total amount of system memory in bytes. - - - - Returns the amount of free system memory in bytes. - - - - Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), - and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq). - - - - Get a list of network interfaces: - - Provides a few basic operating-system related utility functions. - "os" + It supports array access syntax to get and set the octet at index. The values refer to individual bytes, + so the legal range is between 0x00 and 0xFF hex or 0 and 255. + + "buffer" + "Buffer" + - - - - - How many bytes will be returned when `buffer.inspect()` is called. - This can be overridden by user modules. - Default: 50 - - - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + + + + haxe.io.Bytes.ofString(CHARS) + + + + + + + + { complement : true } + + + + + + { complement : true } + + Allows to encode/decode String and bytes using Base64 encoding. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Allows to encode/decode String and bytes using a power of two base dictionary. + + + + + + + + + + + + An abstract type allowing values to be either of `T1` or `T2` type. + Supports implicit casts from/to either types. + + It is useful for interfacing with external code on dynamic platforms + such as JavaScript or Python. + + Otherwise, use of this type is discouraged. + + + + + + A special abstract type that represents "rest" function argument. + + Should be used as a type for the last argument of an extern method, + representing that arbitrary number of arguments of given type can be + passed to that method. + + + + + + The IO is set into nonblocking mode and some data cannot be read or written + An integer value is outside its allowed range + An operation on Bytes is outside of its valid range + + + Other errors + + The possible IO errors that can occur + + + + + + + + + + + + + + + + + + + + + <__unhtml set="method" line="43" static="1"> + + + + <__trace set="method" line="47" static="1"> + + + + + + + + + <__enum__ set="null"> + + + + + + + <__clear_trace set="method" line="67" static="1"> + + + + + + + - Returns `true` if the encoding is a valid encoding argument, or `false` otherwise. - - - + + + + - Tests if `obj` is a `Buffer`. - - - - - - + + + + + + - Gives the actual byte length of a string. - - `encoding` defaults to 'utf8'. - - This is not the same as `String.length` since that - returns the number of characters in a string. - - <_byteLength public="1" get="inline" set="null" line="77" static="1"> - + + + <__string_rec set="method" line="102" static="1"> + + + + + + + + + <__enum__ set="null"> + - - "In haxe 3.3+, use Buffer.byteLength instead!" + "has_enum" - Gives the actual byte length of a string. - - `encoding` defaults to 'utf8'. - - This is not the same as `String.length` since that - returns the number of characters in a string. - - - - - - - - Returns a buffer which is the result of concatenating all the buffers in the `list` together. - - If the `list` has no items, or if the `totalLength` is 0, then it returns a zero-length buffer. - If the `list` has exactly one item, then the first item of the `list` is returned. - If the `list` has more than one item, then a new `Buffer` is created. - - If `totalLength` is not provided, it is read from the buffers in the `list`. - However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - - - - - - - - "compare" - The same as `buf1.compare(buf2)`. Useful for sorting an Array of Buffers. - - - - - - - Create `Buffer` object from `haxe.io.Bytes` using the same underlying data storage. - Any modifications done using the returned object will be reflected in given `haxe.io.Bytes` object. - - - - Returns a JSON-representation of the `Buffer` instance. - - - - - - - - Writes `string` to the buffer at `offset` using the given `encoding`. - - `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. - - Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, - it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. - - The method will not write partial characters. - - - - - - - - - - Writes `string` to the buffer at `offset` using the given `encoding`. - - `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. - - Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, - it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. - - The method will not write partial characters. - - - - - - - - - Writes `string` to the buffer at `offset` using the given `encoding`. - - `offset` defaults to 0, encoding defaults to 'utf8'. `length` is the number of bytes to write. - - Returns number of octets written. If buffer did not contain enough space to fit the entire `string`, - it will write a partial amount of the `string`. `length` defaults to `buffer.length - offset`. - - The method will not write partial characters. - - - - - - Decodes and returns a string from buffer data encoded with `encoding` (defaults to 'utf8') - beginning at `start` (defaults to 0) and ending at `end` (defaults to `buffer.length`). - - - - - - - - Decodes and returns a string from buffer data encoded with `encoding` (defaults to 'utf8') - beginning at `start` (defaults to 0) and ending at `end` (defaults to `buffer.length`). - - - - - - - - - - - Does copy between buffers. - The source and target regions can be overlapped. - `targetStart` and `sourceStart` default to 0. `sourceEnd` defaults to `buffer.length`. - - - - - - - - Returns a new buffer which references the same memory as the old, - but offset and cropped by the `start` (defaults to 0) and `end` (defaults to `buffer.length`) indexes. - Negative indexes start from the end of the buffer. - - Modifying the new buffer slice will modify memory in the original buffer! - - - - - - - - Reads an unsigned 8 bit integer from the buffer at the specified offset. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - - - Reads an unsigned 16 bit integer from the buffer at the specified `offset` with little-endian format. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - + + <__interfLoop set="method" line="174" static="1"> + + + + + <__instanceof set="method" line="189" static="1"> + + + - - Reads an unsigned 16 bit integer from the buffer at the specified `offset` with big-endian format. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - + + + "typed_catch" + + + <__cast set="method" line="228" static="1"> + + + + - Reads an unsigned 32 bit integer from the buffer at the specified `offset` with little-endian format. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - + "typed_cast" + + <__toStr expr="untyped ({ }).toString" line="233" static="1"> + + + + + + + + + + + untyped ({ }).toString + + + <__nativeClassName set="method" line="235" static="1"> + + + - Reads an unsigned 32 bit integer from the buffer at the specified `offset` with big-endian format. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - + + + <__isNativeObj set="method" line="245" static="1"> + + + + <__resolveNativeClass set="method" line="250" static="1"> + + + - Reads a signed 8 bit integer from the buffer at the specified `offset`. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - Works as `readUInt8`, except buffer contents are treated as two's complement signed values. - - - - - - + + + hide + + + + + + + + "EvalError" + + + + + + + + "RangeError" + + + + + + + + "ReferenceError" + + + + + + + + "SyntaxError" + + + + + + + + "TypeError" + + + + + + + + "URIError" + + + + + + Inserts a 'debugger' statement that will make a breakpoint if a debugger is available. + + + + + - Reads a signed 16 bit integer from the buffer at the specified `offset` with little-endian format. - - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - Works as `readUInt16LE`, except buffer contents are treated as two's complement signed values. - - - - - - + + + "Lib.alert() is deprecated, use Browser.alert() instead" + + Display an alert message box containing the given message. + @deprecated Use Browser.alert() instead. + + + + + - Reads a signed 16 bit integer from the buffer at the specified `offset` with big-endian format. + + + + + + + + + + + + Inserts a `require` expression that loads JavaScript object from + a module or file specified in the `module` argument. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + This is only supported in environments where `require` function + is available, such as Node.js or RequireJS. + + + + Returns JavaScript `undefined` value. - Works as `readUInt16BE`, except buffer contents are treated as two's complement signed values. - - - - - - - - Reads a signed 32 bit integer from the buffer at the specified `offset` with little-endian format. + Note that this is only needed in very rare cases when working with external JavaScript code. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + In Haxe, `null` is used to represent the absence of a value. + + + + + + + + `nativeThis` is the JavaScript `this`, which is semantically different + from the Haxe `this`. Use `nativeThis` only when working with external + JavaScript code. - Works as `readUInt32LE`, except buffer contents are treated as two's complement signed values. - - - - - - - - Reads a signed 32 bit integer from the buffer at the specified `offset` with big-endian format. + In Haxe, `this` is always bound to a class instance. + In JavaScript, `this` in a function can be bound to an arbitrary + variable when the function is called using `func.call(thisObj, ...)` or + `func.apply(thisObj, [...])`. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. + Read more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this + + + + + + + + + + + An alias of the JS "global" object. - Works as `readUInt32BE`, except buffer contents are treated as two's complement signed values. - - - - - - - - Reads a 32 bit float from the buffer at the specified `offset` with little-endian format. + Concretely, it is set as the first defined value in the list of + `window`, `global`, `self`, and `this` in the top-level of the compiled output. + + + + + + + + + + + + + + + Re-throw last cathed exception, preserving original stack information. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - + Calling this only makes sense inside a catch statement. + + Platform-specific JavaScript Library. Provides some platform-specific functions + for the JavaScript target. + + + + + + + + + + + + Enumeration of possible Int `options` values for `Dns.lookup`. + + + + + + cast 4 + + + + + + + + cast 6 + + + + + + + + + + + + cast 4 + + + + + + + + cast 6 + + + + + + + + + + + + If present, it should be one or more of the supported `getaddrinfo` flags. + If hints is not provided, then no flags are passed to `getaddrinfo`. + Multiple flags can be passed through hints by logically ORing their values. + + + + + The record family. If not provided, both IP v4 and v6 addresses are accepted. + + + + + When true, the callback returns all resolved addresses in an array, otherwise returns a single address. + Defaults to false. + + + Type of the `options` argument for `Dns.lookup`. + + + + + + Enumeration of possible `rrtype` value for `Dns.resolve`. + + + + + + cast "A" + + + + IPV4 addresses, default + + + + + cast "AAAA" + + + + IPV6 addresses + + + + + cast "MX" + + + + mail exchange records + + + + + cast "TXT" + + + + text records + + + + + cast "SRV" + + + + SRV records + + + + + cast "PTR" + + + + used for reverse IP lookups + + + + + cast "NS" + + + + name server records + + + + + cast "CNAME" + + + + canonical name records + + + + + cast "SOA" + + + + start of authority record + + + + + + + + + cast "A" + + + + IPV4 addresses, default + + + + + cast "AAAA" + + + + IPV6 addresses + + + + + cast "MX" + + + + mail exchange records + + + + + cast "TXT" + + + + text records + + + + + cast "SRV" + + + + SRV records + + + + + cast "PTR" + + + + used for reverse IP lookups + + + + + cast "NS" + + + + name server records + + + + + cast "CNAME" + + + + canonical name records + + + + + cast "SOA" + + + + start of authority record + + + + + + + + + Types of address data returned by `resolve` functions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Values for error codes are listed in `Dns` class. + + Error objects returned by dns lookups are of this type + + + DNS server returned answer with no data. + DNS server claims query was misformatted. + DNS server returned general failure. + Domain name not found. + DNS server does not implement requested operation. + DNS server refused query. + Misformatted DNS query. + Misformatted domain name. + Unsupported address family. + Misformatted DNS reply. + Could not contact DNS servers. + Timeout while contacting DNS servers. + End of file. + Error reading file. + Out of memory. + Channel is being destroyed. + Misformatted string. + Illegal flags specified. + Given hostname is not numeric. + Illegal hints flags specified. + c-ares library initialization not yet performed. + Error loading iphlpapi.dll. + Could not find GetNetworkParams function. + DNS query cancelled. + Each DNS query can return one of the following error codes + + + String + "dns" + + + + + + + + + + + + + + + +
+
+ + + + + + - Reads a 32 bit float from the buffer at the specified `offset` with big-endian format. + Resolves a `hostname` (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - - - Reads a 64 bit double from the buffer at the specified `offset` with little-endian format. + If `options` is not provided, then IP v4 and v6 addresses are both valid. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - - - Reads a 64 bit double from the buffer at the specified `offset` with big-endian format. + The `family` can be the integer 4 or 6. Defaults to null that indicates both Ip v4 and v6 address family. - Set `noAssert` to `true` to skip validation of `offset`. - This means that `offset` may be beyond the end of the buffer. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset`. - Note, `value` must be a valid unsigned 8 bit integer. + The `callback` has arguments (err, address, family). + The `address` argument is a string representation of a IP v4 or v6 address. + The `family` argument is either the integer 4 or 6 and denotes the family + of address (not necessarily the value initially passed to lookup). - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, `value` must be a valid unsigned 16 bit integer. + With the `all` option set, the arguments change to (err, addresses), with addresses being an array of objects + with the properties `address` and `family`. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, `value` must be a valid unsigned 16 bit integer. + Keep in mind that `err.code` will be set to 'ENOENT' not only when the hostname does not exist but + also when the lookup fails in other ways such as no available file descriptors. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, `value` must be a valid unsigned 32 bit integer. + `lookup` doesn't necessarily have anything to do with the DNS protocol. It's only an operating system facility + that can associate name with addresses, and vice versa. + + + + + + + + + + + + + + Resolves a `hostname` (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, `value` must be a valid unsigned 32 bit integer. + If `options` is not provided, then IP v4 and v6 addresses are both valid. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - - - - Writes `value` to the buffer at the specified `offset`. - Note, `value` must be a valid signed 8 bit integer. + The `family` can be the integer 4 or 6. Defaults to null that indicates both Ip v4 and v6 address family. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. + The `callback` has arguments (err, address, family). + The `address` argument is a string representation of a IP v4 or v6 address. + The `family` argument is either the integer 4 or 6 and denotes the family + of address (not necessarily the value initially passed to lookup). - Works as `writeUInt8`, except `value` is written out as a two's complement signed integer into buffer. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, value must be a valid signed 16 bit integer. + With the `all` option set, the arguments change to (err, addresses), with addresses being an array of objects + with the properties `address` and `family`. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. + Keep in mind that `err.code` will be set to 'ENOENT' not only when the hostname does not exist but + also when the lookup fails in other ways such as no available file descriptors. - Works as `writeUInt16LE`, except `value` is written out as a two's complement signed integer into buffer. - - - - - - - - - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, value must be a valid signed 16 bit integer. + `lookup` doesn't necessarily have anything to do with the DNS protocol. It's only an operating system facility + that can associate name with addresses, and vice versa. + + + + + A flag passed in the `hints` argument of `lookup` method. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. + Returned address types are determined by the types of addresses supported by the current system. + For example, IPv4 addresses are only returned if the current system has at least one IPv4 address configured. + Loopback addresses are not considered. + + + + A flag passed in the `hints` argument of `lookup` method. - Works as `writeUInt16BE`, except `value` is written out as a two's complement signed integer into buffer. - - - - + If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. + Note that it is not supported on some operating systems (e.g FreeBSD 10.1). + + + + - + + + + + + - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, value must be a valid signed 32 bit integer. + Resolves the given `address` and `port` into a hostname and service using `getnameinfo`. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. + The `callback` has arguments (err, hostname, service). + The `hostname` and `service` arguments are strings (e.g. 'localhost' and 'http' respectively). - Works as `writeUInt32LE`, except `value` is written out as a two's complement signed integer into buffer. - - - - - - + On error, `err` is an Error object, where `err.code` is the error code. + + + + + + + + + + - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, value must be a valid signed 32 bit integer. + Resolves a `hostname` (e.g. 'google.com') into an array of the record types specified by `rrtype`. - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. + The `callback` has arguments (err, addresses). + The type of each item in `addresses` is determined by the record type, + and described in the documentation for the corresponding lookup methods below. - Works as `writeUInt32BE`, except `value` is written out as a two's complement signed integer into buffer. - - - - - - + On error, `err` is an Error object, where `err.code` is the error code. + + + + + + + + + + + Resolves a `hostname` (e.g. 'google.com') into an array of the record types specified by `rrtype`. + + The `callback` has arguments (err, addresses). + The type of each item in `addresses` is determined by the record type, + and described in the documentation for the corresponding lookup methods below. + + On error, `err` is an Error object, where `err.code` is the error code. + + + + + + + + + + - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, behavior is unspecified if `value` is not a 32 bit float. - - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - + The same as `resolve`, but only for IPv4 queries (A records). + `addresses` is an array of IPv4 addresses (e.g. ['74.125.79.104', '74.125.79.105', '74.125.79.106']). + + + + + + + + + - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, behavior is unspecified if `value` is not a 32 bit float. - - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - + The same as `resolve4` except for IPv6 queries (an AAAA query). + + + + + + + + + - Writes `value` to the buffer at the specified `offset` with little-endian format. - Note, `value` must be a valid 64 bit double. - - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - + The same as `resolve`, but only for mail exchange queries (MX records). + `addresses` is an array of MX records, each with a priority + and an exchange attribute (e.g. [{'priority': 10, 'exchange': 'mx.example.com'},...]). + + + + + + + + + - Writes `value` to the buffer at the specified `offset` with big-endian format. - Note, `value` must be a valid 64 bit double. + The same as `resolve`, but only for text queries (TXT records). + `addresses` is a 2-d array of the text records available for hostname (e.g., [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]). + Each sub-array contains TXT chunks of one record. Depending on the use case, the could be either joined together + or treated separately. + + + + + + + + + + + + The same as `resolve`, but only for service records (SRV records). + `addresses` is an array of the SRV records available for `hostname`. + Properties of SRV records are priority, weight, port, and name + (e.g., [{'priority': 10, 'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]). + + + + + + + + + + + + The same as `resolve`, but only for start of authority record queries (SOA record). - Set `noAssert` to `true` to skip validation of `value` and `offset`. - This means that `value` may be too large for the specific function - and `offset` may be beyond the end of the buffer leading to the values - being silently dropped. This should not be used unless you are certain - of correctness. Defaults to `false`. - - - - - - + `addresses` is an object with the following structure: + { + nsname: 'ns.example.com', + hostmaster: 'root.example.com', + serial: 2013101809, + refresh: 10000, + retry: 2400, + expire: 604800, + minttl: 3600 + } + + + + + + + + + - Fills the buffer with the specified `value`. - If the `offset` (defaults to 0) and `end` (defaults to `buffer.length`) - are not given it will fill the entire buffer. - - - - - - - - Fills the buffer with the specified `value`. - If the `offset` (defaults to 0) and `end` (defaults to `buffer.length`) - are not given it will fill the entire buffer. - - - - - - + The same as `resolve`, but only for name server records (NS records). + `addresses` is an array of the name server records available for hostname (e.g., ['ns1.example.com', 'ns2.example.com']). + + + + + + + + + + - Returns a boolean of whether `this` and `otherBuffer` have the same bytes. - - - - - + The same as `resolve`, but only for canonical name records (CNAME records). + `addresses` is an array of the canonical name records available for hostname (e.g., ['bar.example.com']). + + + + + + + + + + - Returns a number indicating whether `this` comes before or after or is the same as the `otherBuffer` in sort order. - - - - - - + Reverse resolves an `ip` address to an array of hostnames. + The `callback` has arguments (err, hostname). + + + + Returns an array of IP addresses as strings that are currently being used for resolution. + + + + + - Operates similar to `Array.indexOf`. + Given an array of IP addresses as strings, set them as the servers to use for resolving. - Accepts a String, Buffer or Int. - Strings are interpreted as UTF8. - Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. - Int can range from 0 to 255. - - - - - - - - Operates similar to `Array.indexOf`. + If you specify a port with the address it will be stripped, as the underlying library doesn't support that. - Accepts a String, Buffer or Int. - Strings are interpreted as UTF8. - Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. - Int can range from 0 to 255. - - - - - - - - Operates similar to `Array.indexOf`. + This will throw if you pass invalid input. + + This module contains functions that belong to two different categories: - Accepts a String, Buffer or Int. - Strings are interpreted as UTF8. - Buffers will use the entire buffer. So in order to compare a partial `Buffer` use `slice`. - Int can range from 0 to 255. - - - - - - Create `haxe.io.Bytes` object that uses the same underlying data storage as `this` buffer. - Any modifications done using the returned object will be reflected in the `this` buffer. - - - + 1) Functions that use the underlying operating system facilities to perform name resolution, + and that do not necessarily do any network communication. This category contains only one function: `lookup`. + Developers looking to perform name resolution in the same way that other applications on the same operating + system behave should use `lookup`. + + 2) Functions that connect to an actual DNS server to perform name resolution, + and that always use the network to perform DNS queries. This category contains all functions in the dns module but `lookup`. + These functions do not use the same set of configuration files than what `lookup` uses. For instance, + they do not use the configuration from /etc/hosts. These functions should be used by developers who do not want + to use the underlying operating system's facilities for name resolution, and instead want to always perform DNS queries. + "dns" + + + + + + + + + + Object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq + + + + + + CPUTime data. + + - - - Allocates a new buffer. - - - - - - - - Allocates a new buffer. - - - - - - - Allocates a new buffer. - - - - - - - Allocates a new buffer. - - - - The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways. + MHz Speed + + + + CPU Model. E.g. 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz' + + + Object containing information about each CPU/core installed: model, speed (in MHz), and times + + + + Objects containing information about network interface addresses. + + + + + Whether this address is internal. + + + + IP address family (e.g. IPv4, IPv6). + +
+ + IP address (format depends on family). +
+
+ + + + + + + + + cast "BE" + + + + + + + + cast "LE" + + + + + + + + + + + + cast "BE" + + + + + + + + cast "LE" + + + + + + + + + + A constant defining the appropriate End-of-line marker for the operating system. + + + + Returns the operating system's default directory for temp files. + + + + Returns the endianness of the CPU. Possible values are "BE" or "LE". + + + + Returns the hostname of the operating system. + + + + Returns the operating system name. + + + + Returns the operating system platform. + + + + Returns the operating system CPU architecture. + + + + Returns the operating system release. + + + + Returns the system uptime in seconds. + + + + Returns an array containing the 1, 5, and 15 minute load averages. - It supports array access syntax to get and set the octet at index. The values refer to individual bytes, - so the legal range is between 0x00 and 0xFF hex or 0 and 255. - - "buffer" - "Buffer" - + The load average is a measure of system activity, calculated by the operating system and expressed as a fractional number. + As a rule of thumb, the load average should ideally be less than the number of logical CPUs in the system. + + The load average is a very UNIX-y concept; there is no real equivalent on Windows platforms. + That is why this function always returns [0, 0, 0] on Windows. + + + + Returns the total amount of system memory in bytes. + + + + Returns the amount of free system memory in bytes. + + + + Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), + and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq). + + + + Get a list of network interfaces: + + Provides a few basic operating-system related utility functions. + "os" - + Enumeration of events emitted by all `EventEmitter` instances. - + @@ -7945,7 +7670,7 @@ - + @@ -7986,16 +7711,16 @@ - + Abstract type for events. Its type parameter is a signature of a listener for a concrete event. - + - - + + @@ -8022,11 +7747,11 @@ Objects returned from `Fs.stat`, `Fs.lstat` and `Fs.fstat` and their synchronous counterparts are of this type. - + - + @@ -8045,7 +7770,7 @@ - + @@ -8063,18 +7788,18 @@ - + Writable file stream. - + Enumeration of possible HTTP methods as described in http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - + @@ -8142,7 +7867,7 @@ - + @@ -8209,12 +7934,12 @@ - + Enumeration of events emitted by the `ServerResponse` objects in addition to its parent class events. - + @@ -8240,7 +7965,7 @@ - + @@ -8265,12 +7990,12 @@ - + Enumeration of events for `Socket` objects. - + @@ -8381,7 +8106,7 @@ - + @@ -8491,7 +8216,7 @@ - + If true, then the socket won't automatically send a FIN packet @@ -8502,7 +8227,7 @@ Default: false - + @@ -8533,7 +8258,7 @@ Options for creating new `Socket` object. - + @@ -8573,14 +8298,14 @@ Options for the `Socket.connect` method (TCP version). - + Path the client should connect to Options for the `Socket.connect` method (Local domain socket version). - + @@ -8597,12 +8322,12 @@ Bound address, the address family name and port of the socket as reported by the operating system. - + Enumeration of possible socket family values. - + @@ -8622,7 +8347,7 @@ - + @@ -8641,7 +8366,7 @@ - + @@ -8771,7 +8496,7 @@ "Duplex" - + @@ -9005,7 +8730,7 @@ "Socket" - + @@ -9031,13 +8756,13 @@ Options for `Duplex` private constructor. For stream implementors only, see node.js API documentation - - + + Enumeration of events emitted by the `Readable` class. - + @@ -9108,7 +8833,7 @@ - + @@ -9178,7 +8903,7 @@ - + @@ -9196,12 +8921,12 @@ Options for `Readable` private constructor. For stream implementors only, see node.js API documentation - + Enumeration for `Writable` class events. - + @@ -9268,7 +8993,7 @@ - + @@ -9334,7 +9059,7 @@ - +