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.
- Loading branch information
Showing
8 changed files
with
58 additions
and
50 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const multiaddr = require('multiaddr') | ||
const pull = require('pull-stream') | ||
|
||
const WS = require('./src') | ||
|
||
let listener | ||
|
||
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) | ||
} | ||
} | ||
} | ||
} |
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,3 +1,6 @@ | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
@@ -36,3 +39,4 @@ node_modules | |
*.swp | ||
|
||
dist | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,16 +4,16 @@ | |
"description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"lint": "aegir-lint", | ||
"test": "gulp test", | ||
"test:node": "gulp test:node", | ||
"test:browser": "gulp test:browser", | ||
"build": "gulp build", | ||
"release": "gulp release", | ||
"release-minor": "gulp release --type minor", | ||
"release-major": "gulp release --type major", | ||
"coverage": "gulp coverage", | ||
"coverage-publish": "aegir-coverage publish" | ||
"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", | ||
"coverage": "aegir coverage", | ||
"coverage-publish": "aegir coverage --upload" | ||
}, | ||
"browser": { | ||
"pull-ws/server": false | ||
|
@@ -42,15 +42,16 @@ | |
"pull-ws": "^3.2.9" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^11.0.2", | ||
"aegir": "github:ipfs/aegir", | ||
"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" | ||
"pull-stream": "^3.6.0", | ||
"safe-buffer": "^5.1.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