diff --git a/.aegir.js b/.aegir.js new file mode 100644 index 0000000..55dc385 --- /dev/null +++ b/.aegir.js @@ -0,0 +1,11 @@ +'use strict' + +module.exports = { + webpack: { + resolve: { + }, + externals: { + 'simple-websocket-server': '{}' + } + } +} diff --git a/README.md b/README.md index 8fe4896..833511c 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ js-libp2p-spdy [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) -[![Coverage Status](https://coveralls.io/repos/github/diasdavid/js-libp2p-spdy/badge.svg?branch=master)](https://coveralls.io/github/diasdavid/js-libp2p-spdy?branch=master) -[![Dependency Status](https://david-dm.org/diasdavid/js-libp2p-spdy.svg?style=flat-square)](https://david-dm.org/diasdavid/js-libp2p-spdy) -[![Travis CI](https://travis-ci.org/diasdavid/js-libp2p-spdy.svg?branch=master)](https://travis-ci.org/diasdavid/js-libp2p-spdy) -[![Circle CI](https://circleci.com/gh/diasdavid/js-libp2p-spdy.svg?style=svg)](https://circleci.com/gh/diasdavid/js-libp2p-spdy) +[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-spdy/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-spdy?branch=master) +[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-spdy.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-spdy) +[![Travis CI](https://travis-ci.org/libp2p/js-libp2p-spdy.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-spdy) +[![Circle CI](https://circleci.com/gh/libp2p/js-libp2p-spdy.svg?style=svg)](https://circleci.com/gh/libp2p/js-libp2p-spdy) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) > SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface -[![](https://github.com/diasdavid/interface-stream-muxer/raw/master/img/badge.png)](https://github.com/diasdavid/interface-stream-muxer) +[![](https://github.com/libp2p/interface-stream-muxer/raw/master/img/badge.png)](https://github.com/libp2p/interface-stream-muxer) # Installation diff --git a/gulpfile.js b/gulpfile.js index 3230c80..0f85bfe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,7 +11,7 @@ let ws gulp.task('test:browser:before', (done) => { ws = new WSlibp2p() const mh = multiaddr('/ip4/127.0.0.1/tcp/9095/ws') - ws.createListener(mh, (transportSocket) => { + const listener = ws.createListener((transportSocket) => { const muxedConn = spdy(transportSocket, true) muxedConn.on('stream', (connRx) => { @@ -19,7 +19,8 @@ gulp.task('test:browser:before', (done) => { connRx.pipe(connTx) connTx.pipe(connRx) }) - }, done) + }) + listener.listen(mh, done) }) gulp.task('test:browser:after', (done) => { diff --git a/package.json b/package.json index 3c6afac..ac22da6 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/diasdavid/js-libp2p-spdy.git" + "url": "https://github.com/libp2p/js-libp2p-spdy.git" }, "keywords": [ "IPFS" @@ -31,15 +31,15 @@ "author": "David Dias ", "license": "MIT", "bugs": { - "url": "https://github.com/diasdavid/js-libp2p-spdy/issues" + "url": "https://github.com/libp2p/js-libp2p-spdy/issues" }, - "homepage": "https://github.com/diasdavid/js-libp2p-spdy", + "homepage": "https://github.com/libp2p/js-libp2p-spdy", "devDependencies": { - "aegir": "^3.0.4", + "aegir": "^3.2.0", "bl": "^1.1.2", "chai": "^3.5.0", "interface-stream-muxer": "^0.3.1", - "libp2p-websockets": "^0.6.0", + "libp2p-websockets": "^0.7.0", "multiaddr": "^2.0.0", "pre-commit": "^1.1.2", "stream-pair": "^1.0.3", @@ -55,4 +55,4 @@ "JGAntunes ", "dignifiedquire " ] -} \ No newline at end of file +} diff --git a/test/browser.js b/test/browser.js index dbf546e..c2d717f 100644 --- a/test/browser.js +++ b/test/browser.js @@ -8,9 +8,9 @@ const multiaddr = require('multiaddr') describe('browser-server', () => { let ws - before((done) => { + + before(() => { ws = new WSlibp2p() - done() }) it('ricochet test', (done) => { diff --git a/test/spdy-over-ws.node.js b/test/spdy-over-ws.node.js index ebed803..a401c09 100644 --- a/test/spdy-over-ws.node.js +++ b/test/spdy-over-ws.node.js @@ -17,18 +17,18 @@ describe('spdy-over-ws', () => { let ws let mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ws') - before((done) => { + before(() => { ws = new WSlibp2p() - - done() }) it('attach to a websocket, as listener', (done) => { - ws.createListener(mh, (socket) => { + const wsListener = ws.createListener((socket) => { expect(socket).to.exist listener = spdy(socket, true) expect(listener).to.exist - }, done) + }) + + wsListener.listen(mh, done) }) it('attach to a websocket, as dialer', (done) => {