git ssb

16+

Dominic / patchbay



Tree: da787189e650087caa476419997849d890f75995

Files: da787189e650087caa476419997849d890f75995 / config.js

756 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,
28 blobsUrl
29 }
30}
31
32
33

Built with git-ssb-web