From 937cc17e84606e3fdaf7b40e8eff07c2a7ebead0 Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 6 Sep 2016 17:36:36 -0400 Subject: [PATCH] refactor(api): follow spec interface --- examples/dialer.js | 2 +- examples/listener.js | 2 +- gulpfile.js | 2 +- package.json | 2 +- test/browser.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/dialer.js b/examples/dialer.js index e8cbb9d..da215e1 100644 --- a/examples/dialer.js +++ b/examples/dialer.js @@ -6,7 +6,7 @@ const toPull = require('stream-to-pull-stream') const libp2pSPDY = require('../src') const socket = tcp.connect(9999) -const muxer = libp2pSPDY.dial(toPull(socket)) +const muxer = libp2pSPDY.dialer(toPull(socket)) muxer.on('stream', (stream) => { console.log('-> got new muxed stream') diff --git a/examples/listener.js b/examples/listener.js index 27331d8..360156f 100644 --- a/examples/listener.js +++ b/examples/listener.js @@ -8,7 +8,7 @@ const libp2pSPDY = require('../src') const listener = tcp.createServer((socket) => { console.log('-> got connection') - const muxer = libp2pSPDY.listen(toPull(socket)) + const muxer = libp2pSPDY.listener(toPull(socket)) muxer.on('stream', (stream) => { console.log('-> got new muxed stream') diff --git a/gulpfile.js b/gulpfile.js index 61cbfb8..8465719 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -13,7 +13,7 @@ gulp.task('test:browser:before', (done) => { const ws = new WSlibp2p() const mh = multiaddr('/ip4/127.0.0.1/tcp/9095/ws') listener = ws.createListener((transportSocket) => { - const muxedConn = spdy.listen(transportSocket) + const muxedConn = spdy.listener(transportSocket) muxedConn.on('stream', (connRx) => { const connTx = muxedConn.newStream() pull(connRx, connTx, connRx) diff --git a/package.json b/package.json index 1edac20..49c0f16 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "devDependencies": { "aegir": "^6.0.1", "chai": "^3.5.0", - "interface-stream-muxer": "^0.3.1", + "interface-stream-muxer": "^0.4.0", "libp2p-tcp": "^0.8.0", "libp2p-websockets": "^0.8.0", "multiaddr": "^2.0.0", diff --git a/test/browser.js b/test/browser.js index 0c371bf..5b7db96 100644 --- a/test/browser.js +++ b/test/browser.js @@ -18,7 +18,7 @@ describe('browser-server', () => { it('ricochet test', (done) => { const mh = multiaddr('/ip4/127.0.0.1/tcp/9095/ws') const transportSocket = ws.dial(mh) - const muxedConn = spdy.dial(transportSocket) + const muxedConn = spdy.dialer(transportSocket) muxedConn.on('stream', (conn) => { pull(