You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unclear from the readme as to what sort of stream plainstream is -- source, transform, sink? It would be cool to see an example that sends some data between client and server, like a chatting example, if I'm not misunderstanding this too badly.
varSHS=require('secret-handshake')varcl=require('chloride')varappKey= ... //32 random bytesvaralice=cl.crypto_sign_keypair()//clientvarbob=cl.crypto_sign_keypair()//serverfunctionauthorize(id,cb){cb(null,check(id))//check wether id is authorized.}//initialize, with default timeouts.varServerStream=SHS.createServer(alice,authorize,appKey)varClientStream=SHS.createClient(bob,appkey)varalice_stream=ServerStream(function(err,stream){
...
// **in here, what do you do with stream?**})varbob_stream=ClientStream(alice.publicKey,function(err,stream){
...
})//simulate a streaming network connection by connecting streams togetherpull(alice_stream,bob_stream,alice_stream)
The text was updated successfully, but these errors were encountered:
It's unclear from the readme as to what sort of stream
plainstream
is -- source, transform, sink? It would be cool to see an example that sends some data between client and server, like a chatting example, if I'm not misunderstanding this too badly.The text was updated successfully, but these errors were encountered: