socks5 0.0.1 copy "socks5: ^0.0.1" to clipboard
socks5: ^0.0.1 copied to clipboard

outdated

SOCKS5 connection initializer

socks #

A SOCKS5 connection handler

Example #

/// [SOCKSSocket] uses a raw socket to authorize 
/// and request a connection, connect to your socks proxy server
final sock = await RawSocket.connect(InternetAddress.loopbackIPv4, 9050);

/// pass the socket to [SOCKSSocket]
final proxy = SOCKSSocket(sock);

/// request the proxy to connect to a host
/// this call will throw exceptions if connection attempt fails from the proxy
await proxy.connect("google.com:80");

/// Now you can use the [sock] from earlier, since we can only listen
/// once on a [RawSocket] we must set the [onData] function to intercept 
/// the events from the socket
proxy.subscription.onData((RawSocketEvent event) {
    /// [RawSocketEvent] messages are here
    /// read from here.. 
    if (ev == RawSocketEvent.read) {
      final data = sock.read(sock.available());
      ...
    }
});

/// To connect with an [InternetAddress] use:
/// await s.connectIp(InternetAddress.loopbackIPv4, 80);

/// keepOpen=false will call close the [RawSocket]
await proxy.close(keepOpen: false);
0
likes
0
pub points
11%
popularity

Publisher

verified publisherv0l.io

SOCKS5 connection initializer

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on socks5