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

LateInitializationError if socket refused the connection #1

Open
simonesestito opened this issue Jan 17, 2024 · 0 comments · May be fixed by #2
Open

LateInitializationError if socket refused the connection #1

simonesestito opened this issue Jan 17, 2024 · 0 comments · May be fixed by #2

Comments

@simonesestito
Copy link

simonesestito commented Jan 17, 2024

Hi, I was using this library to connect to a SOCKS5 proxy and I find it very useful.

However, I encountered the following bug.

Steps to reproduce

// Connect to a socks5 that is not listening -> The connection will be refused
final proxy = Socks5ClientDialer("127.0.0.1", 9150);

// Get the socket
try {
    final socket = await proxy.connect("example.com", 80);
} catch (err, stackTrace) {
    print(err);
    print(stackTrace);
}

Expected result

The thrown error should be SocketException

Actual result

The thrown error is:

LateInitializationError: Local 'socket' has not been initialized.
#0      LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:189:5)
#1      Socks5ClientDialer.connect (package:socks5_io/src/client_dialer.dart:53:11)
<asynchronous suspension>
@simonesestito simonesestito linked a pull request Jan 17, 2024 that will close this issue
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 a pull request may close this issue.

1 participant