1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

fix(gcr/s,c) register stream handlers

This commit is contained in:
Brian Tiger Chow
2015-01-30 08:02:43 -08:00
parent d80e9aba7a
commit 46bbd11e6b
3 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,7 @@ func GrandCentralServer(recordSource datastore.ThreadSafeDatastore) core.Routing
Handler: server,
Local: node.Identity,
}
node.PeerHost.SetStreamHandler(gcproxy.ProtocolGCR, proxy.HandleStream)
return grandcentral.NewClient(proxy, node.Peerstore, node.Identity)
}
}
@ -75,6 +76,7 @@ func GrandCentralClient(remotes ...peer.PeerInfo) core.RoutingOption {
ids = append(ids, info.ID)
}
proxy := gcproxy.Standard(node.PeerHost, ids)
node.PeerHost.SetStreamHandler(gcproxy.ProtocolGCR, proxy.HandleStream)
return grandcentral.NewClient(proxy, node.Peerstore, node.Identity)
}
}