git ssb

1+

dinoworm ๐Ÿ› / vas



Tree: 0b4d6451ce5d4f2f2c503793f5ac1c61b10bc4ac

Files: 0b4d6451ce5d4f2f2c503793f5ac1c61b10bc4ac / connect.js

400 bytesRaw
1var pull = require('pull-stream')
2var Ws = require('pull-ws-server')
3var Url= require('url')
4
5module.exports = connect
6
7function connect (client, config) {
8 var stream = Ws.connect(getUrl(config), config)
9
10 pull(
11 stream,
12 client.createStream(),
13 stream
14 )
15
16 return client
17}
18
19function getUrl (config) {
20 return typeof config.url === 'string' ?
21 config.url : Url.format(config.url)
22}
23

Built with git-ssb-web