Skip to content

luo3house/dart_socks5_io

Repository files navigation

socks5_io

Pub Version

IO based socks5 implementation written in dart.

Install

Add dependency to pubspec.yaml.

dependencies:
  socks5_io: ^0.2.0

Quick Start

final dialer = Socks5ClientDialer("127.0.0.1", 7890);
dialer.connect("example.org", 80).then((socks5) {

  // handle remote server response
  socks5.getReader().listen((buffer) {
    print(ascii.decode(buffer));
    socks5.close();
  },
    onError: (err) => {/* handle transfer error */},
    onDone: () => {/* handle target closed */},
  );

  // send request (non-blocking)
  socks5.getWriter().add(ascii.encode([
    "GET / HTTP/1.1",
    "Host: example.org:80",
    "User-Agent: socks5_io/0.2.0",
    "Accept: */*",
    "\r\n",
  ].join("\r\n")));

}).catchError((err) {/* handle connect error */});

See more at folder example/.

Acknowledgement

LICENSE

MIT

Releases

No releases published

Packages

No packages published

Languages