Skip to content
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

Support proxy and onion #392

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Dec 18, 2024

This PR introduces and supports Onion3 multiaddr for tentacle-multiaddr and adds socks5 proxy support for tentacle dialing. It also allows tentacle to connect to a Tor server to reach an onion address.

A breaking change introduced is:

  1. Changing

    pub(crate) type TcpSocketConfig =
        Arc<dyn Fn(TcpSocket) -> Result<TcpSocket, std::io::Error> + Send + Sync + 'static>;

    to:

    pub(crate) type TcpSocketTransformer =
        Arc<dyn Fn(TcpSocket) -> Result<TcpSocket, std::io::Error> + Send + Sync + 'static>;
    
    pub(crate) struct TcpSocketConfig {
        pub(crate) socket_transformer: TcpSocketTransformer,
        pub(crate) proxy_config: Option<ProxyConfig>,
    }
  2. Adding an Onion variant to the TransportType enum and implementing OnionTransport.

  3. Allow runtime::connect to use a socks5 proxy for connecting to the target address.

  4. Add runtime::connect_onion to connect to a target address of the Multiaddr type, rather than just a SocketAddr, since tentacle cannot convert an onion address into a SocketAddr.

@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 3 times, most recently from 0b06264 to 36312c5 Compare December 18, 2024 08:05
@eval-exec eval-exec marked this pull request as ready for review December 18, 2024 08:10
@eval-exec eval-exec requested a review from driftluo as a code owner December 18, 2024 08:10
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 5 times, most recently from c6bef08 to fc55cd7 Compare December 19, 2024 01:16
Signed-off-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from c2f84e0 to d41cd7a Compare December 19, 2024 01:52
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from d41cd7a to 0312d4b Compare December 19, 2024 05:54
@eval-exec eval-exec marked this pull request as draft December 19, 2024 05:55
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 0312d4b to 0b033f4 Compare December 19, 2024 06:32
Signed-off-by: Eval EXEC <execvy@gmail.com>
…ocket and return a Result<TcpSocket>

Signed-off-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 5cf255c to 20df0ad Compare December 20, 2024 07:02
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 84c01d0 to 6b1f15f Compare December 23, 2024 08:07
Signed-off-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 6b1f15f to f620bfe Compare December 23, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant