started browser code
This commit is contained in:
parent
2f87cd3797
commit
fb55be240d
|
@ -0,0 +1,17 @@
|
|||
;(function () {
|
||||
'use strict';
|
||||
|
||||
var dnsjs = window.DNSPacket;
|
||||
// I got the test data by running this in the node console:
|
||||
// JSON.stringify(fs.readFileSync('./test/fixtures/www.google.com.a.bin', null))
|
||||
var arr = [
|
||||
191,164,129,128,0,1,0,5,0,0,0,0,3,119,119,119,6,103,111,111,103,108,101,3,99
|
||||
,111,109,0,0,1,0,1,192,12,0,1,0,1,0,0,0,29,0,4,74,125,239,112,192,12,0,1,0,1,0
|
||||
,0,0,29,0,4,74,125,239,116,192,12,0,1,0,1,0,0,0,29,0,4,74,125,239,113,192,12,0
|
||||
,1,0,1,0,0,0,29,0,4,74,125,239,115,192,12,0,1,0,1,0,0,0,29,0,4,74,125,239,114
|
||||
];
|
||||
var ab = Uint8Array.from(arr).buffer;
|
||||
var result = dnsjs.parse(ab);
|
||||
console.log(result);
|
||||
|
||||
}());
|
23
demo.html
23
demo.html
|
@ -1,3 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<!--
|
||||
|
||||
This demo is meant to have 3 feilds that accept base-64, hex and array values the user
|
||||
|
@ -5,3 +8,23 @@ can copy in, and a button that will call the dns parser to parse the input and d
|
|||
the output in a seperate field.
|
||||
|
||||
-->
|
||||
<!-- run `serve-https` to test at https://localhost.daplie.me:8443/demo.html -->
|
||||
|
||||
<!-- put form here -->
|
||||
|
||||
<!-- I added some of the library files for you -->
|
||||
<script src="./dns.types.js"></script>
|
||||
<script src="./dns.classes.js"></script>
|
||||
<script src="./dns.type.a.js"></script>
|
||||
<script src="./dns.rdata.parse.js"></script>
|
||||
<script src="./dns.unpack-labels.js"></script>
|
||||
<script src="./dns.parser.js"></script>
|
||||
<script src="./dns.packer.js"></script>
|
||||
<script src="./dns.js"></script>
|
||||
|
||||
<!-- put jquery here -->
|
||||
|
||||
<!-- application code in here -->
|
||||
<script src="./browser.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(function (exports) {
|
||||
'use strict';
|
||||
|
||||
var pdns = module.exports.DNS_PACK = function () {
|
||||
var pdns = exports.DNS_PACK = function () {
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;(function (exports) {
|
||||
'use strict';
|
||||
|
||||
var pdns = module.exports.DNS_PARSER = {};
|
||||
var pdns = exports.DNS_PARSER = {};
|
||||
|
||||
var classes = exports.DNS_CLASSES || require('./dns.classes.js').DNS_CLASSES;
|
||||
var types = exports.DNS_TYPES || require('./dns.types.js').DNS_TYPES;
|
||||
|
|
Loading…
Reference in New Issue