tHandle the JSON response in dam.go - tordam - A library for peer discovery inside the Tor network HTML git clone https://git.parazyd.org/tordam DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 1f5ef5ad7276d8d633933b95036f431f33e3e424 DIR parent a35a59a7538832581d0f5b6ec1f4ca7e9837a7a4 HTML Author: parazyd <parazyd@dyne.org> Date: Thu, 7 Dec 2017 21:01:53 +0100 Handle the JSON response in dam.go Diffstat: M go/dam/dam.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- DIR diff --git a/go/dam/dam.go b/go/dam/dam.go t@@ -5,6 +5,7 @@ package main import ( "encoding/base64" "encoding/json" + "io/ioutil" "log" "os" t@@ -38,6 +39,7 @@ func main() { "address": lib.OnionFromPubkey(key.PublicKey), "message": "I'm a DECODE node!", "signature": encodedSig, + "secret": "", } log.Println("Announcing keypair for:", vals["address"]) t@@ -48,5 +50,10 @@ func main() { log.Println("Sending request") resp := lib.HTTPPost("http://localhost:8080/announce", jsonVal) - log.Println(resp) + body, err := ioutil.ReadAll(resp.Body) + lib.CheckError(err) + + // TODO: Handle the secret decryption and returning it back decrypted to the + // directory. Note to self: start saving state on ddir's side. + log.Println(string(body)) }