This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: filter IPFS addrs correctly (#62)
* feat: dns support for WS * fix: address parsing * feat: filter IPFS addrs correctly * fix: remove lodash includes dependency * feat: mafmt addrs now support /ipfs no need for ad-hoc filtering * feat: skip p2p-circuit addresses * chore: updating ci files * chore: upgrading to new aegir * test: pass the no-parallel flag to tests * wip * test: removing global timeout and setting it on a specific test * feat: resolve 0 addresses (#64) * feat: resolve 0 addresses * chore: upgrading pull-ws * chore: update circle CI * chore: update gitignore * chore: update deps * chore: update CI again * test: fix node.js tests * test: fix browser tests * chore
- Loading branch information
Showing
8 changed files
with
128 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
'use strict' | ||
|
||
const multiaddr = require('multiaddr') | ||
const pull = require('pull-stream') | ||
|
||
const WS = require('./src') | ||
|
||
let listener | ||
|
||
function boot (done) { | ||
const ws = new WS() | ||
const ma = multiaddr('/ip4/127.0.0.1/tcp/9095/ws') | ||
listener = ws.createListener((conn) => pull(conn, conn)) | ||
listener.listen(ma, done) | ||
} | ||
|
||
function shutdown (done) { | ||
listener.close(done) | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
browser: { | ||
pre (callback) { | ||
const ws = new WS() | ||
const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ws') | ||
listener = ws.createListener((conn) => pull(conn, conn)) | ||
listener.listen(ma, callback) | ||
}, | ||
post (callback) { | ||
listener.close(callback) | ||
} | ||
pre: boot, | ||
post: shutdown | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ | |
"main": "src/index.js", | ||
"scripts": { | ||
"lint": "aegir lint", | ||
"test": "aegir test", | ||
"test:node": "aegir test --target=node", | ||
"test:browser": "aegir test --target=browser", | ||
"build": "aegir build", | ||
"release": "aegir release", | ||
"release-minor": "aegir release --type minor", | ||
"release-major": "aegir release --type major", | ||
"test": "aegir test --target node --target browser --no-parallel", | ||
"test:node": "aegir test --target node", | ||
"test:browser": "aegir test --target browser --no-parallel", | ||
"release": "aegir test release --target node --target browser --no-parallel", | ||
"release-minor": "aegir release --type minor --target node --target browser", | ||
"release-major": "aegir release --type major --target node --target browser", | ||
"coverage": "aegir coverage", | ||
"coverage-publish": "aegir coverage --upload" | ||
"coverage-publish": "aegir coverage --provider coveralls" | ||
}, | ||
"browser": { | ||
"pull-ws/server": false | ||
|
@@ -39,19 +39,18 @@ | |
"interface-connection": "~0.3.2", | ||
"lodash.includes": "^4.3.0", | ||
"mafmt": "^3.0.1", | ||
"pull-ws": "^3.2.9" | ||
"pull-ws": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "github:ipfs/aegir", | ||
"aegir": "^12.0.8", | ||
"chai": "^4.1.1", | ||
"dirty-chai": "^2.0.1", | ||
"gulp": "^3.9.1", | ||
"interface-transport": "~0.3.5", | ||
"multiaddr": "^3.0.1", | ||
"pre-commit": "^1.2.2", | ||
"pull-goodbye": "0.0.2", | ||
"pull-stream": "^3.6.0", | ||
"safe-buffer": "^5.1.1" | ||
"pull-stream": "^3.6.1" | ||
}, | ||
"contributors": [ | ||
"Chris Campbell <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters