adds a simple example on the way to having something as fully featured as n0's unfortunately named dumbpipe
currently you can use this to e.g. pipe text files across an iroh connection. where i want to get is something like this but which also works with tcp streams and does so in a very svelte way (not having to reimplement too much of net.Conn/Addr and everything related to that). not sure how far i'll get on that but i want to see :)
as for source code origin declarations: #neverslop
adds a simple example on the way to having something as fully featured as n0's unfortunately named [ `dumbpipe`](https://www.dumbpipe.dev/)
currently you can use this to e.g. pipe text files across an iroh connection. where i want to get is something like this but which also works with tcp streams and does so in a very svelte way (not having to reimplement too much of net.Conn/Addr and everything related to that). not sure how far i'll get on that but i want to see :)
as for source code origin declarations: #neverslop
also kinda progresses #14 in that the SimplePipe type sketches a vague outline of the diff between iroh.SendStream / iroh.RecvStream and go's Reader/Writer interfaces
also kinda progresses #14 in that the SimplePipe type sketches a vague outline of the diff between iroh.SendStream / iroh.RecvStream and go's Reader/Writer interfaces
marked as wip bc i'd like to figure out how to neatly close on the receiver side. like, what's required from the sender? it could also be a matter of improving my very barebones implementation of the Reader/Writer interfaces so that they function w/ errors as intended
marked as wip bc i'd like to figure out how to neatly close on the receiver side. like, what's required from the sender? it could also be a matter of improving my very barebones implementation of the Reader/Writer interfaces so that they function w/ errors as intended
cblgh
marked the pull request as ready for review 2026-10-18 13:07:52 +00:00
aight i think as of d2fbde7c3b it does enough now (sends EOF if current data read == 0 && we have previously read data)
aight i think as of https://git.coopcloud.tech/decentral1se/iroh-go/commit/d2fbde7c3bc39e5bc2688f3ecd82bb58a512762a it does enough now (sends EOF if current data read == 0 && we have previously read data)
(sorry for any & all thinking-out-loud comments that end up in yer email inbox d1!!)
2hrs later edit:
another reference, this time for i2p + tor support. this feels to me like it is going in a more complex direction though. not sure if it is needed or something simpler could do the job
after looking at tor/listen.go i think the gist of this approach is to implement the net.Listener interface. the easy way to do it is to have a struct field that is a literal net.Listener instance -- listen.go's is OnionService.LocalListener -- gotten by calling net.Listen() to which we can punt most of the implementing of net.Listener's interface methods
next day edit:
here's the newer version of onramp but probably a lot more complex to look at for first steps than the earlier version
barebones net.Conn impl above actually just relies on return value from net.Dialgo-i2p/sam3/sam3.go
re my tcp ambitions, this could maybe be a good starting point for launching investigations
* https://github.com/KatelynHaworth/go-tproxy/tree/master
* https://github.com/KatelynHaworth/go-tproxy/blob/master/example/tproxy_example.go
(sorry for any & all thinking-out-loud comments that end up in yer email inbox d1!!)
2hrs later edit:
another reference, this time for i2p + tor support. this feels to me like it is going in a more complex direction though. not sure if it is needed or something simpler could do the job
* https://github.com/eyedeekay/onramp#usage
* https://github.com/eyedeekay/onramp/blob/main/garlic.go 🧄
* https://github.com/eyedeekay/onramp/blob/main/EXAMPLE.md#usage-as-instance-of-a-struct-listener <-- this demonstrates exactly what i want to achieve tho! :)
* https://github.com/cblgh/cerca/blob/main/server/server.go#L1034 this approach is compatible with how cerca's server is defined (and was actually made so by the author of onramp/garlic.go!)
onramp's tor parts might be easier to digest:
* https://github.com/eyedeekay/onramp/blob/main/onion.go
* https://github.com/cretz/bine/tree/master/tor
* https://github.com/cretz/bine/blob/master/tor/listen.go (server - serve tcp connection)
* https://github.com/cretz/bine/blob/master/tor/dialer.go (client - open tcp connection)
after looking at `tor/listen.go` i think the gist of this approach is to implement the `net.Listener` interface. the easy way to do it is to have a struct field that is a literal net.Listener instance -- listen.go's is `OnionService.LocalListener` -- gotten by calling `net.Listen()` to which we can punt most of the implementing of `net.Listener`'s interface methods
---
next day edit:
here's the newer version of `onramp` but probably a lot more complex to look at for first steps than the earlier version
* https://github.com/go-i2p/onramp
another day's edit:
* here's a good example on actually implementing a dialer [go-i2p/sam3/stream.go](https://github.com/go-i2p/sam3/blob/883c757e71f86a102c6ac909411a26eb0c23976f/stream.go#L240)
* barebones net.Conn implementation [go-i2p/sam3/SAMConn.go](https://github.com/go-i2p/sam3/blob/883c757e71f86a102c6ac909411a26eb0c23976f/SAMConn.go#L10-L66)
* barebones net.Conn impl above actually just relies on return value from `net.Dial` [go-i2p/sam3/sam3.go](https://github.com/go-i2p/sam3/blob/883c757e71f86a102c6ac909411a26eb0c23976f/sam3.go#L76)
I noticed that if you don't pass -v -secret ... on the receiver side, it just hangs. Also, if you miss the binary in the .gitignore, it always ends up wanting to be checked in with Git. I've tested this with success locally and remotely. Really Cool ™️
Will keep reading along and am very curious about the final API surface 🙏
@cblgh loving this, please do continue 🍿🍿🍿
I noticed that if you don't pass `-v -secret ...` on the receiver side, it just hangs. Also, if you miss the binary in the `.gitignore`, it always ends up wanting to be checked in with Git. I've tested this with success locally and remotely. Really Cool ™️
Will keep reading along and am very curious about the final API surface 🙏
@decentral1se yo ty for the testing! yeah it hangs but only because the endpoint is randomly generated to be something you don't know about XD latest commit addresses that by always dumping the '-endpoint xxx` line to stderr, which shouldn't cause any issues with redirecting the output to e.g. another file
ty for the .gitignore prod, i'm notoriously bad at including binaries there lol; cerca has a couple of binaries lurking in its git history that are unnecessarily inflating its size because of this tendency hehe
i've got some shit brewin with the tcp brainstorming from above btw but am having some issues with the last mile. rn a bit confused how to prototype the dialing of the incoming tcp connection (currently curl via dumbpipe) so that my iroh+tcp listener process doesn't hang forever waiting for a tcp connection that seemingly is never made
@decentral1se yo ty for the testing! yeah it hangs but only because the endpoint is randomly generated to be something you don't know about XD latest commit addresses that by always dumping the '-endpoint xxx` line to stderr, which shouldn't cause any issues with redirecting the output to e.g. another file
ty for the .gitignore prod, i'm notoriously bad at including binaries there lol; cerca has a couple of binaries lurking in its git history that are unnecessarily inflating its size because of this tendency hehe
---
i've got some shit brewin with the tcp brainstorming from above btw but am having some issues with the last mile. rn a bit confused how to prototype the dialing of the incoming tcp connection (currently curl via dumbpipe) so that my iroh+tcp listener process doesn't hang forever waiting for a tcp connection that seemingly is never made
woop woop, my very simple echo serve over iroh is working :)
note to self: don't just hand-wave the Writer/Reader implementation haha :') i think it was getting stuck there a few times and through various small tweaks and absolutely chaotic hardcoding i managed to understand enough of the problem to get this to work. i think a more robust solution would probably look slightly different, especially if there's a 'native dialer' in go for these bits. but dang it works :)!
woop woop, my very simple echo serve over iroh is working :)
note to self: don't just hand-wave the Writer/Reader implementation haha :') i think it was getting stuck there a few times and through various small tweaks and absolutely chaotic hardcoding i managed to understand enough of the problem to get this to work. i think a more robust solution would probably look slightly different, especially if there's a 'native dialer' in go for these bits. but dang it works :)!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
adds a simple example on the way to having something as fully featured as n0's unfortunately named
dumbpipecurrently you can use this to e.g. pipe text files across an iroh connection. where i want to get is something like this but which also works with tcp streams and does so in a very svelte way (not having to reimplement too much of net.Conn/Addr and everything related to that). not sure how far i'll get on that but i want to see :)
as for source code origin declarations: #neverslop
dbb27dfeedto854789084calso kinda progresses #14 in that the SimplePipe type sketches a vague outline of the diff between iroh.SendStream / iroh.RecvStream and go's Reader/Writer interfaces
854789084ctobd83d74e6cbd83d74e6ctod4d0a3229fmarked as wip bc i'd like to figure out how to neatly close on the receiver side. like, what's required from the sender? it could also be a matter of improving my very barebones implementation of the Reader/Writer interfaces so that they function w/ errors as intended
aight i think as of
d2fbde7c3bit does enough now (sends EOF if current data read == 0 && we have previously read data)re my tcp ambitions, this could maybe be a good starting point for launching investigations
(sorry for any & all thinking-out-loud comments that end up in yer email inbox d1!!)
2hrs later edit:
another reference, this time for i2p + tor support. this feels to me like it is going in a more complex direction though. not sure if it is needed or something simpler could do the job
onramp's tor parts might be easier to digest:
after looking at
tor/listen.goi think the gist of this approach is to implement thenet.Listenerinterface. the easy way to do it is to have a struct field that is a literal net.Listener instance -- listen.go's isOnionService.LocalListener-- gotten by callingnet.Listen()to which we can punt most of the implementing ofnet.Listener's interface methodsnext day edit:
here's the newer version of
onrampbut probably a lot more complex to look at for first steps than the earlier versionanother day's edit:
net.Dialgo-i2p/sam3/sam3.god2fbde7c3btodb430e2dff@cblgh loving this, please do continue 🍿🍿🍿
I noticed that if you don't pass
-v -secret ...on the receiver side, it just hangs. Also, if you miss the binary in the.gitignore, it always ends up wanting to be checked in with Git. I've tested this with success locally and remotely. Really Cool ™️Will keep reading along and am very curious about the final API surface 🙏
@decentral1se yo ty for the testing! yeah it hangs but only because the endpoint is randomly generated to be something you don't know about XD latest commit addresses that by always dumping the '-endpoint xxx` line to stderr, which shouldn't cause any issues with redirecting the output to e.g. another file
ty for the .gitignore prod, i'm notoriously bad at including binaries there lol; cerca has a couple of binaries lurking in its git history that are unnecessarily inflating its size because of this tendency hehe
i've got some shit brewin with the tcp brainstorming from above btw but am having some issues with the last mile. rn a bit confused how to prototype the dialing of the incoming tcp connection (currently curl via dumbpipe) so that my iroh+tcp listener process doesn't hang forever waiting for a tcp connection that seemingly is never made
woop woop, my very simple echo serve over iroh is working :)
note to self: don't just hand-wave the Writer/Reader implementation haha :') i think it was getting stuck there a few times and through various small tweaks and absolutely chaotic hardcoding i managed to understand enough of the problem to get this to work. i think a more robust solution would probably look slightly different, especially if there's a 'native dialer' in go for these bits. but dang it works :)!
🥇
Resolved a merge conflict & merged to main:
3b7f953540Pull request closed