Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Only supports Tor target addresses #1

Open
tcharding opened this issue Jul 24, 2020 · 4 comments
Open

Only supports Tor target addresses #1

tcharding opened this issue Jul 24, 2020 · 4 comments

Comments

@tcharding
Copy link
Collaborator

tcharding commented Jul 24, 2020

Problem

Currently the dial method of the transport converts the input Multiaddr into a string address that is in the form that Tor expects.

Onion v3 Multiaddr: /onion3/7gr3dngwhk74thi4vv6bm3v3bicaxe4apvcemoxo3hadpvsyfifjqnid:7
Tor address: 7gr3dngwhk74thi4vv6bm3v3bicaxe4apvcemoxo3hadpvsyfifjqnid.onion:7

Clearly this address conversion will not work for non-tor proxies.

Solution discussion

In order to support other SOCKS5 proxies we need to control how the multi address is converted into an address for the target SOCKS5 proxy. See the dial method, specifically:

        let dest = tor_address_string(addr.clone())
            .ok_or_else(|| TransportError::MultiaddrNotSupported(addr))?;

This functionality will somehow need to be made configurable.

@thomaseizinger
Copy link

We don't necessarily have to bail if it is something else other than a tor address right? We could just pass on whatever we got passed. There are probably more applications that can run over socks5 so over time, this list could be extended.

I am thinking of something like:

let dest = match segment {
	"onion" => parse_tor_address,
	"foobar" => parse_foo_bar_address,
	_ => addr
};

@thomaseizinger
Copy link

thomaseizinger commented Jan 22, 2021

I guess this could also be made even more dynamical by parsing functions in the constructor and store them as Box<Fn>.

@tcharding
Copy link
Collaborator Author

Thanks for the comment. I'm not personally super motivated to extend this crate for use with other proxies since I have no need for it. I wanted to say, I appreciate you taking the time to think about this issue though.

@thomaseizinger
Copy link

Thanks for the comment. I'm not personally super motivated to extend this crate for use with other proxies since I have no need for it. I wanted to say, I appreciate you taking the time to think about this issue though.

No sweat, no immediate need on my side either but I was interested in thinking about the problem :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants