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

feat: Tor support: add optional HttpClient param for proxy/SOCKS/Tor support #92

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

sneurlax
Copy link
Contributor

Here's an example of how we use this change in Stack Wallet:

HttpClient? _httpClient;
if (prefs.useTor) {
  final ({InternetAddress host, int port}) proxyInfo =
      TorService.sharedInstance.getProxyInfo();

  _httpClient = HttpClient();
  SocksTCPClient.assignToHttpClient(
      _httpClient!, [ProxySettings(proxyInfo.host, proxyInfo.port)]);
} else {
  _httpClient = null;
}

_stellarSdk = stellar.StellarSDK("${currentNode.host}:${currentNode.port}",
    httpClient: _httpClient);

Then we use StellarSDK as normal.

@sneurlax
Copy link
Contributor Author

Closes #91

@christian-rogobete christian-rogobete self-assigned this Apr 26, 2024
@christian-rogobete christian-rogobete merged commit a418233 into Soneso:master Apr 26, 2024
@christian-rogobete
Copy link
Contributor

Hello @sneurlax, thank you for adding the optional HttpClient param!

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

Successfully merging this pull request may close these issues.

2 participants