mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-04-25 19:22:25 +00:00
feat: add support for dialing over dns
License: MIT Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
parent
a0c23e49f7
commit
eba0b48744
@ -39,7 +39,7 @@
|
|||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"interface-transport": "~0.3.6",
|
"interface-transport": "~0.3.6",
|
||||||
"lodash.isfunction": "^3.0.9",
|
"lodash.isfunction": "^3.0.9",
|
||||||
"pull-stream": "^3.6.7"
|
"pull-stream": "^3.6.9"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-is": "^1.1.0",
|
"class-is": "^1.1.0",
|
||||||
@ -48,8 +48,8 @@
|
|||||||
"ip-address": "^5.8.9",
|
"ip-address": "^5.8.9",
|
||||||
"lodash.includes": "^4.3.0",
|
"lodash.includes": "^4.3.0",
|
||||||
"lodash.isfunction": "^3.0.9",
|
"lodash.isfunction": "^3.0.9",
|
||||||
"mafmt": "^6.0.0",
|
"mafmt": "^6.0.2",
|
||||||
"multiaddr": "^4.0.0",
|
"multiaddr": "^5.0.0",
|
||||||
"once": "^1.4.0",
|
"once": "^1.4.0",
|
||||||
"stream-to-pull-stream": "^1.7.2"
|
"stream-to-pull-stream": "^1.7.2"
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,8 @@ describe('interface-transport compliance', () => {
|
|||||||
const addrs = [
|
const addrs = [
|
||||||
multiaddr('/ip4/127.0.0.1/tcp/9091'),
|
multiaddr('/ip4/127.0.0.1/tcp/9091'),
|
||||||
multiaddr('/ip4/127.0.0.1/tcp/9092'),
|
multiaddr('/ip4/127.0.0.1/tcp/9092'),
|
||||||
multiaddr('/ip4/127.0.0.1/tcp/9093')
|
multiaddr('/ip4/127.0.0.1/tcp/9093'),
|
||||||
|
multiaddr('/dns4/ipfs.io')
|
||||||
]
|
]
|
||||||
cb(null, tcp, addrs)
|
cb(null, tcp, addrs)
|
||||||
},
|
},
|
||||||
|
@ -25,9 +25,11 @@ describe('filter addrs', () => {
|
|||||||
const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
|
const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
|
||||||
const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs)
|
const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs)
|
||||||
const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs)
|
const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs)
|
||||||
|
const ma7 = multiaddr('/dns4/libp2p.io/tcp/9090')
|
||||||
|
const ma8 = multiaddr('/dnsaddr/libp2p.io/tcp/9090')
|
||||||
|
|
||||||
const valid = tcp.filter([ma1, ma2, ma3, ma4, ma5, ma6])
|
const valid = tcp.filter([ma1, ma2, ma3, ma4, ma5, ma6, ma7, ma8])
|
||||||
expect(valid.length).to.equal(2)
|
expect(valid.length).to.equal(4)
|
||||||
expect(valid[0]).to.deep.equal(ma1)
|
expect(valid[0]).to.deep.equal(ma1)
|
||||||
expect(valid[1]).to.deep.equal(ma4)
|
expect(valid[1]).to.deep.equal(ma4)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user