Banging things around to get a duct-taped version working end-to-end

This commit is contained in:
Dave Hrycyszyn
2019-11-29 12:30:03 +00:00
parent 98ab153978
commit 8ee4bd0fb9
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -27,6 +27,7 @@ fn fake_directory_mixes() -> Vec<SphinxNode> {
address: [0u8; 32], //"127.0.0.1:8080".as_bytes(), // start here tomorrow :)
pub_key: Default::default()
};
// vec![node1]
let node2 = sphinx::route::Node{
address: [1u8;32],
pub_key: Default::default()
+1 -1
View File
@@ -11,10 +11,10 @@ impl MixClient {
MixClient {}
}
// Sends a Sphinx packet to a mixnode.
pub async fn send(&self, packet: SphinxPacket, mix: &MixNode) -> Result<(), Box<dyn std::error::Error>>{
let bytes = packet.to_bytes();
// now we shoot it into space!
let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
stream.write_all(&bytes[..]).await?;
Ok(())