git ssb

15+

ansuz / dnssb



Commit fb9bdfe76f66353d2c55d805c9c36e8796e91855

allow server to bind to ::1 and other short-form ip6en

ansuz committed on 11/6/2016, 10:03:01 PM
Parent: 9d7c9503d4789a0d9739342a23fbc219b0707ed7

Files changed

lib/server.jschanged
package.jsonchanged
lib/server.jsView
@@ -1,8 +1,10 @@
11 var Pull = require("pull-stream");
22 var Ansuz = require("ansuz");
33 var Query = require("./query");
44 var Dump = require("./dump");
5 +var Net = require("net");
6 +var Pad = require("pad-ipv6");
57
68 var Server = module.exports = {};
79
810 var log = {
@@ -57,8 +59,10 @@
5759 });
5860 };
5961
6062 var createServer = Server.create = function (sbot, port, host, cb, opt) {
63 + if (Net.isIPv6(host)) { host = Pad(host); }
64 +
6165 var Dnsd = require("modern-dnsd");
6266 var server = Dnsd.createServer(function(req, res) {
6367 answer(sbot, req, res, opt);
6468 });
package.jsonView
@@ -1,7 +1,7 @@
11 {
22 "name": "ssb-dns",
3- "version": "1.2.1",
3 + "version": "1.2.2",
44 "description": "resolve dns via ssb",
55 "main": "index.js",
66 "bin": {
77 "dnssb": "index.js",

Built with git-ssb-web