Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/socks_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SOCKSSocket {
StreamSubscription<List<int>>? get subscription => _subscription;

/// Is SSL enabled?
final bool sslEnabled;
bool sslEnabled;

/// Private constructor.
SOCKSSocket._(this.proxyHost, this.proxyPort, this.sslEnabled);
Expand Down Expand Up @@ -216,6 +216,12 @@ class SOCKSSocket {
/// Returns:
/// A Future that resolves to void.
Future<void> connectTo(String domain, int port) async {
// Onion services provide their own end-to-end encryption, so disable the
// TLS upgrade when connecting to a .onion domain.
if (domain.endsWith('.onion')) {
sslEnabled = false;
}

// Connect command.
var request = [
0x05, // SOCKS version.
Expand Down
Loading