Live data from Hacker News

Iroh: A library to establish direct connection between peers

github.com

51–60 of 61 posts

Re: Iroh: A library to establish direct connection between peers

#51
post #30

I work on connet [1] and from what I've seen iroh seem pretty cool. A few random thoughts I had while watching the presentations/reading the docs: * the relays serve both for discovery and relay. In connet these are separate responsibilities, e.g. it has control server for discovery and a relay server for relaying connections. * it seems that the connections to the relays in iroh are TCP (at least what was said in on…

There might be a small misunderstanding here. Our relays do two things. They relay user data, and relay a small number of special packets to help with hole punching. Other than that they are very simple. They never see unencrypted data, so they don't know anything more about the nodes they serve than what they need to function.

Connections are TCP https websocket connections, because this is most likely to get through even the most restrictive firewalls.

Discovery is handled outside the relays, via either a special DNS server or via the bittorrent mainline DHT. You can even implement your own discovery.

Re: Iroh: A library to establish direct connection between peers

#52
post #40
post #28

Earlier quoted context omitted.

Pardon me for jumping in the discussion, but I didn't know where else to ask this. Does Iroh support streaming, instead of moving blobs? I want to write a little p2p tool to forward one port from one machine to another. Also, forwarding UDP packets doesn't require the congestion control of QUIC. Does Iroh allow disabling it for a certain "message" or stream?

Yes. Iroh itself provides direct QUIC connections. iroh-blobs is a protocol on top of iroh that provides content-addressed data transfer of BLAKE3 hashed data. What you describe sounds like https://www.dumbpipe.dev/ , a tool/demo built on top of iroh to provide a bidirectional pipe across devices, somewhat like netcat. Dumbpipe also has a mode where it listens on a port using TCP. It sounds like you want to basically…

[dead]

Re: Iroh: A library to establish direct connection between peers

#53
post #39
post #28

Earlier quoted context omitted.

Pardon me for jumping in the discussion, but I didn't know where else to ask this. Does Iroh support streaming, instead of moving blobs? I want to write a little p2p tool to forward one port from one machine to another. Also, forwarding UDP packets doesn't require the congestion control of QUIC. Does Iroh allow disabling it for a certain "message" or stream?

It looks like they have examples with unreliable channels: https://github.com/n0-computer/iroh/tree/main/iroh/examples You'll prob have to check the max packet size that you want to forward because quic adds a bit of overhead.

[dead]

Re: Iroh: A library to establish direct connection between peers

#54
post #12

Iroh is intriguing. Dumbpipe is magical, and its implementation is easy to understand. I use dumbpipe daily to expose cross-stream ( https://github.com/cablehead/xs ) stores I run on different servers to my local laptop's `xs` client.

A bit off topic I guess, but what’s your usage for xs? I read the website, I think that I understand it and find it intriguing, but I’m not sure what one would use it for.

A basic use case, to tie it back to the topic :)

When I'm working on a remote machine, it's nice to be able to easily pass things back and forth between it and my local laptop. I start a stream on the remote server and use `dumbpipe` to make the stream available on my local laptop.

```

# remote

xs serve ./store --expose :3001 ; dumbpipe listen-tcp --host 127.0.0.1:3001

# local

dumbpipe connect-tcp --addr 127.0.0.1:3001

$env.XS_ADDR ":3001" ; .cat

```

I can then do things like:

```

# local

cat local.file | .append local.file

# remote

.head local.file | .cas

```

Or register a local handler for the topic "pasteboard" that puts the contents on my local clipboard. Then, from the remote machine, I can run: `"foo" | .append pasteboard`

Re: Iroh: A library to establish direct connection between peers

#56
post #51
post #30

I work on connet [1] and from what I've seen iroh seem pretty cool. A few random thoughts I had while watching the presentations/reading the docs: * the relays serve both for discovery and relay. In connet these are separate responsibilities, e.g. it has control server for discovery and a relay server for relaying connections. * it seems that the connections to the relays in iroh are TCP (at least what was said in on…

There might be a small misunderstanding here. Our relays do two things. They relay user data, and relay a small number of special packets to help with hole punching. Other than that they are very simple. They never see unencrypted data, so they don't know anything more about the nodes they serve than what they need to function. Connections are TCP https websocket connections, because this is most likely to get throug…

Thanks for the correction, I'm still new to iroh and looking to learn more!

Seems that the relays in iroh play the role of STUN and TURN (maybe even implement these)?

I'd have to read more about DNS discovery (and dht), very interesting.

Re: Iroh: A library to establish direct connection between peers

#57

I attended a workshop for iroh a while ago and really enjoyed it, and from what I can tell on the Discord server the folks developing it are gearing for a 1.0 release soon-ish. There's also Dumb Pipe and SendMe which are demos (I believe) built on iroh to showcase some of its uses, and at the workshop we were shown a video of a startup using iroh for video game streaming (something similar to the old OnLive). From wh…

Was the workshop recorded?

For those interested, this lower level walkthrough is great: https://www.youtube.com/watch?v=ogN_mBkWu7o

There is also a high level walkthrough in the same video library.

Re: Iroh: A library to establish direct connection between peers

#58

Earlier quoted context omitted.

This is very much like my usecase too, except that I need to be able to use it via FFI since my engine is not Rust.

we do have https://github.com/n0-computer/iroh-c-ffi which is lowlevel but directly usable from any c like language

Oh nice, thanks for that. Do you think I should hold my breath for a UDP transport or just use it to negotiate direct socket connections?

Re: Iroh: A library to establish direct connection between peers

#60

Some years ago, "iroh" was supposed to a replacement for ipfs. However since then, they (very smartly, in my opinion) dropped those ambitions and are just focused on being a high-quality library for anyone writing a P2P app (like ipfs). I often see projects attempting to be a universe tool to solve every possible problem, and I think the iroh folks were smart to scale back and narrow their focus

Aye. You often solve a technical problem while working to build something and later it turns out that building block has more utility than the thing you set out to build.
Post reply on HN