v0l / socks5

SOCKS5 implemented in dart
GNU General Public License v3.0
3 stars 2 forks source link

Sample app doesn't work #5

Closed fusion44 closed 3 years ago

fusion44 commented 3 years ago

I've tried the sample app but I don't receive any data. I tried to make make sure the TOR service is running correctly by issuing a curl command: curl --socks5-hostname localhost:9050 https://check.torproject.org => Congratulations. This browser is configured to use Tor.

After some time the RawSocketEvent.readClosed is emitted. I've modified the sample to include onError and onDone but none of them are ever called.

    proxy.subscription.onData((RawSocketEvent event) {
      /// [RawSocketEvent] messages are here
      /// read from here..
      if (event == RawSocketEvent.read) {
        final data = sock.read(sock.available());
        print(data);
      } else {
        print(event);
      }
    });

    proxy.subscription.onError((error) => print);
    proxy.subscription.onDone(() => print('done'));

Any idea? Thank you!

v0l commented 3 years ago

Are you using mobile device with Orbot? Or for desktop?

v0l commented 3 years ago

Its been a while since i used this lib, maybe you can check the project i was building it for over here: https://github.com/v0l/misq/blob/master/misq-p2p/lib/internal/connection.dart#L67

fusion44 commented 3 years ago

I'm using Linux Desktop. I'll take a look at misq. Thanks!

v0l commented 3 years ago

What kind of connection are you making? I tested the example and its working fine.

v0l commented 3 years ago

I added some HTTP calls over TOR in the tests: https://github.com/v0l/socks5/blob/master/test/socks_test.dart#L50

Working fine on desktop linux for me (Ubuntu)

fusion44 commented 3 years ago

I misunderstood how to use the library. I thought await s.connect("google.com:80"); immediately would result in data being returned but it can't return as I've never requested any. Makes sense and works as intended now.

Thank you!