git ssb

3+

dangerousbeans / scuttle-vue



Tree: 68d042cfbe29198d1147fd3e4d3d90fe1d485648

Files: 68d042cfbe29198d1147fd3e4d3d90fe1d485648 / config.js

772 bytesRaw
1
2var URL = require('url')
3
4module.exports = function () {
5 var remote = 'undefined' === typeof localStorage
6 ? null //'ws://localhost:8989~shs:' + require('./keys')
7 : localStorage.remote
8
9
10 //TODO: use _several_ remotes, so if one goes down,
11 // you can still communicate via another...
12 // also, if a blob does not load, use another pub...
13
14 //if we are the light client, get our blobs from the same domain.
15 var blobsUrl
16 if(remote) {
17 var r = URL.parse(remote.split('~')[0])
18 //this will work for ws and wss.
19 r.protocol = r.protocol.replace('ws', 'http')
20 r.pathname = '/blobs/get'
21 blobsUrl = URL.format(r)
22 }
23 else
24 blobsUrl = 'http://localhost:8989/blobs/get'
25
26 return {
27 remote: remote,
28 blobsUrl: blobsUrl
29 }
30}
31

Built with git-ssb-web