-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for a native Tor proxy #670
Conversation
It might also be a worthy discussion whether we should disallow plain-text IRC when having the Tor proxy defined, as using a plain-text protocol over Tor is obviously a huge compromise of privacy. |
Thanks for this PR! Will take a look at this during this week <3 |
Hey @cvengler thanks for this! Sorry for the delay on review. I've been wrapping up url previews but I'll look at digging into this after we get that merged. Just wanted to give you a heads up that we haven't forgotten about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! A couple minor nits. I'll want to test this and assess the dependency used prior to merging. Thanks for this!
@tarkah is there any release deadline or something coming closer? I would prefer to address the issues you have mentioned next week due to time issues. |
Should be fine, we already decided to wait for a few big features so we can use the extra testing period before we release. |
a47b9e5
to
bfbd7f9
Compare
I have adressed the issues and rebased it to the current main branch. |
This commit implements native support for using Tor (i.e. not using an intermediate SOCKS5 connection) into Halloy, using Arti, the official Tor implementation in Rust. It does so, by adding a third proxy type named `Tor`, that co-exists between `Socks5` and `Http`. In order to achieve that change, a breaking change in the proxy syntax was necessary, as a native Tor proxy obviously does not need a host nor a port. With this change, configuring a proxy looks like this: ```toml [proxy] http = { host = "127.0.0.1", port = 9150 } socks5 = { host = "127.0.0.1", port = 9150 } tor = {} ``` Besides this, it also wraps the internally used `TcpStream` data structure behind an `IRCStream` enum which implements the `AsyncRead`, `AsyncWrite` and `Unpin` traits and also wraps the `DataStream` used by Tor into it. It remains an open question how good this implementation is. Personally, I am a bit afraid that it will leak at a few places, namely the checking for updates as well as the file transfer feature. Further evaluation is needed here. Regarding the usefulness of the feature: Primarily I think that this is a neat addition by having a monolithic binary that uses Tor without depending on any other system resources. Besides this, it may even be possible to drop support for `Socks5` and `Http` proxies entirely if this feature matures even further, as Tor is basically the only reason why modern applications still include support for `socks5` (and maybe `http`). Alongside it would probably also make Halloy the first IRC client ever with native Tor support. 🙂 As a disclaimer: Professionally I am a part of the team responsible for developing Arti. This pull request is a personal project however which I develop entirely in my free time.
bfbd7f9
to
a6cb241
Compare
@cvengler Thanks! I've updated the dependency to use I tested w/ ergo testnet and the proxied connection works 👍 I noticed Libera doesn't allow these tor proxied connections and instead suggests connecting to their onion service. It seems we can do that w/ I think this is good to go! Edit: I can get |
@casperstorm can you confirm testing on windows & mac to Edit: He confirmed w/ me both work & I tested linux. We also tested |
This commit implements native support for using Tor (i.e. not using an intermediate SOCKS5 connection) into Halloy, using Arti, the official Tor implementation in Rust.
It does so, by adding a third proxy type named
Tor
, that co-exists betweenSocks5
andHttp
. In order to achieve that change, a breaking change in the proxy syntax was necessary, as a native Tor proxy obviously does not need a host nor a port.With this change, configuring a proxy looks like this:
Besides this, it also wraps the internally used
TcpStream
data structure behind anIRCStream
enum which implements theAsyncRead
,AsyncWrite
andUnpin
traits and also wraps theDataStream
used by Tor into it.It remains an open question how good this implementation is. Personally, I am a bit afraid that it will leak at a few places, namely the checking for updates as well as the file transfer feature. Further evaluation is needed here.
Regarding the usefulness of the feature: Primarily I think that this is a neat addition by having a monolithic binary that uses Tor without depending on any other system resources. Besides this, it may even be possible to drop support for
Socks5
andHttp
proxies entirely if this feature matures even further, as Tor is basically the only reason why modern applications still include support forSocks5
(and maybeHttp
). Alongside it would probably also make Halloy the first IRC client ever with native Tor support. 🙂As a disclaimer: Professionally I am a part of the team responsible for developing Arti. This pull request is a personal project however which I develop entirely in my free time.