git ssb

2+

Dominic / ssb-client



Commit e9c39ad310d8b1e80181c27d4852fc235a60b385

Merge branch 'master' of https://github.com/arj03/ssb-client into tor

Dominic Tarr committed on 10/2/2016, 7:13:35 AM
Parent: 5e25721cf49edb99a5a6c9c1c02a43a255e49a2f
Parent: e66a0e6adee402fb45653a6d80fff9bc929c719a

Files changed

index.jschanged
index.jsView
@@ -7,8 +7,9 @@
77
88 var MultiServer = require('multiserver')
99 var WS = require('multiserver/plugins/ws')
1010 var Net = require('multiserver/plugins/net')
11 +var Onion = require('multiserver/plugins/onion')
1112 var Shs = require('multiserver/plugins/shs')
1213
1314 var muxrpc = require('muxrpc')
1415 var pull = require('pull-stream')
@@ -55,9 +56,12 @@
5556 var host = opts.host || 'localhost'
5657 var port = opts.port || config.port || 8008
5758 var key = opts.key || keys.id
5859
59- remote = 'net:'+host+':'+port+'~shs:'+key.substring(1).replace('.ed25519', '')
60 + var protocol = 'net:'
61 + if (host.endsWith(".onion"))
62 + protocol = 'onion:'
63 + remote = protocol+host+':'+port+'~shs:'+key.substring(1).replace('.ed25519', '')
6064 }
6165
6266 var manifest = opts.manifest || (function () {
6367 try {
@@ -79,8 +83,9 @@
7983 })
8084
8185 var ms = MultiServer([
8286 [Net({}), shs],
87 + [Onion({}), shs],
8388 [WS({}), shs]
8489 ])
8590
8691 ms.client(remote, function (err, stream) {

Built with git-ssb-web