Commit fb9bdfe76f66353d2c55d805c9c36e8796e91855
allow server to bind to ::1 and other short-form ip6en
ansuz committed on 11/6/2016, 10:03:01 PMParent: 9d7c9503d4789a0d9739342a23fbc219b0707ed7
Files changed
lib/server.js | changed |
package.json | changed |
lib/server.js | ||
---|---|---|
@@ -1,8 +1,10 @@ | ||
1 | 1 … | var Pull = require("pull-stream"); |
2 | 2 … | var Ansuz = require("ansuz"); |
3 | 3 … | var Query = require("./query"); |
4 | 4 … | var Dump = require("./dump"); |
5 … | +var Net = require("net"); | |
6 … | +var Pad = require("pad-ipv6"); | |
5 | 7 … | |
6 | 8 … | var Server = module.exports = {}; |
7 | 9 … | |
8 | 10 … | var log = { |
@@ -57,8 +59,10 @@ | ||
57 | 59 … | }); |
58 | 60 … | }; |
59 | 61 … | |
60 | 62 … | var createServer = Server.create = function (sbot, port, host, cb, opt) { |
63 … | + if (Net.isIPv6(host)) { host = Pad(host); } | |
64 … | + | |
61 | 65 … | var Dnsd = require("modern-dnsd"); |
62 | 66 … | var server = Dnsd.createServer(function(req, res) { |
63 | 67 … | answer(sbot, req, res, opt); |
64 | 68 … | }); |
Built with git-ssb-web