Skip to content

Instantly share code, notes, and snippets.

@sajal
Created March 27, 2015 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajal/290b63d981014c3a5106 to your computer and use it in GitHub Desktop.
Save sajal/290b63d981014c3a5106 to your computer and use it in GitHub Desktop.
Web browser example for RIPE ATLAS DNS

First run

npm install -g browserify
npm install -g native-dns-packet
browserify main.js > bundle.js
<html>
<head>
<title>Example</title>
<script src="bundle.js">
<head>
<body>
<script>alert(getpacket("f2+AgAABAAEAAAAAA3d3dwRyaXBlA25ldAAAAQABwAwAAQABAAA3+gAEwQAGiw=="));</script>
</body>
</html>
var Packet = require('native-dns-packet');
getpacket = function(packet){
var buf = new Buffer(packet, 'base64');
var p = Packet.parse(buf)
return p
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment