Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6cec898

Browse files
committedMay 24, 2024·
fix breaking changes against iroh main branch
1 parent eaed31e commit 6cec898

File tree

3 files changed

+206
-210
lines changed

3 files changed

+206
-210
lines changed
 

‎Cargo.lock

+196-201
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ description = "A cli tool to pipe data over the network, with NAT hole punching"
1414
anyhow = "1.0.75"
1515
clap = { version = "4.4.10", features = ["derive"] }
1616
hex = "0.4.3"
17-
iroh-net = { version = "0.16" }
18-
quinn = { version = "0.10", package = "iroh-quinn" }
17+
iroh-net = { git="https://github.com/n0-computer/iroh", branch="main" }
18+
# iroh-net = { version = "0.17" }
19+
quinn = { version = "0.10.5", package = "iroh-quinn" }
1920
tokio = { version = "1.34.0", features = ["full"] }
2021
tokio-util = "0.7.10"
2122
tracing = "0.1.40"

‎src/main.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use anyhow::Context;
33
use clap::{Parser, Subcommand};
44
use dumbpipe::NodeTicket;
55
use iroh_net::{
6+
endpoint::{get_remote_node_id, Connecting},
67
key::SecretKey,
7-
magic_endpoint::{get_remote_node_id, Connecting},
8-
MagicEndpoint, NodeAddr,
8+
Endpoint, NodeAddr,
99
};
1010
use std::{
1111
io,
@@ -258,7 +258,7 @@ async fn forward_bidi(
258258

259259
async fn listen_stdio(args: ListenArgs) -> anyhow::Result<()> {
260260
let secret_key = get_or_create_secret()?;
261-
let endpoint = MagicEndpoint::builder()
261+
let endpoint = Endpoint::builder()
262262
.alpns(vec![args.common.alpn()?])
263263
.secret_key(secret_key)
264264
.bind(args.common.magic_port)
@@ -320,7 +320,7 @@ async fn listen_stdio(args: ListenArgs) -> anyhow::Result<()> {
320320

321321
async fn connect_stdio(args: ConnectArgs) -> anyhow::Result<()> {
322322
let secret_key = get_or_create_secret()?;
323-
let endpoint = MagicEndpoint::builder()
323+
let endpoint = Endpoint::builder()
324324
.secret_key(secret_key)
325325
.alpns(vec![])
326326
.bind(args.common.magic_port)
@@ -353,7 +353,7 @@ async fn connect_tcp(args: ConnectTcpArgs) -> anyhow::Result<()> {
353353
.to_socket_addrs()
354354
.context(format!("invalid host string {}", args.addr))?;
355355
let secret_key = get_or_create_secret()?;
356-
let endpoint = MagicEndpoint::builder()
356+
let endpoint = Endpoint::builder()
357357
.alpns(vec![])
358358
.secret_key(secret_key)
359359
.bind(args.common.magic_port)
@@ -370,7 +370,7 @@ async fn connect_tcp(args: ConnectTcpArgs) -> anyhow::Result<()> {
370370
async fn handle_tcp_accept(
371371
next: io::Result<(tokio::net::TcpStream, SocketAddr)>,
372372
addr: NodeAddr,
373-
endpoint: MagicEndpoint,
373+
endpoint: Endpoint,
374374
handshake: bool,
375375
alpn: &[u8],
376376
) -> anyhow::Result<()> {
@@ -429,7 +429,7 @@ async fn listen_tcp(args: ListenTcpArgs) -> anyhow::Result<()> {
429429
Err(e) => anyhow::bail!("invalid host string {}: {}", args.host, e),
430430
};
431431
let secret_key = get_or_create_secret()?;
432-
let endpoint = MagicEndpoint::builder()
432+
let endpoint = Endpoint::builder()
433433
.alpns(vec![args.common.alpn()?])
434434
.secret_key(secret_key)
435435
.bind(args.common.magic_port)

0 commit comments

Comments
 (0)
Please sign in to comment.