socks_socket 1.4.0
socks_socket: ^1.4.0 copied to clipboard
SOCKS version 5 sockets for Dart and Flutter, *eg.* ElectrumX and/or Fulcrum over Tor via socket(s).
1.4.0 #
- Add
SocksConnection.startforHttpClient.connectionFactory(Dart 3.5). - Validate targets, tokens and proxy replies.
- Keep handshake replies out of
inputStream; buffer input until a listener attaches. - Bound SSL handshakes; add
securityContextandrequireIsolation(defaults to true with a token: a no-auth proxy is now rejected). - Serialize
writeandoutputStream; report transport failures asSocksConnectionException. - Reject overlapping connect calls; track peer close in
state;close()orcancel()during connect spends the instance. - Rename
ConnectionStatetoSocksSocketState(alias kept); addsocks.dartfor Flutter.
1.3.0 #
Features #
- Typed exception hierarchy: sealed
SocksExceptionwithSocksHandshakeException,SocksRequestException,SocksConnectionException, andSocksCancelledException. All implementExceptionfor backward compatibility. SocksReplyCodeenum covering all 8 SOCKS5 reply codes (RFC 1928) withfromByte()lookup.- Tor circuit isolation via
isolationTokenparameter oncreate()andreconnect(). Sends token as SOCKS5 username/password auth (RFC 1929) to request separate Tor circuits. cancel()method to abort in-flightconnect()/connectTo()operations. No-op when already connected or disconnected.
1.2.0 (unpublished; included in 1.3.0) #
Bug Fixes #
- Fix fragmented SOCKS5 response reassembly (previously caused RangeError).
- Fix connection hang when proxy drops without responding; now times out.
- Fix SSL socket leak in
close(). - Fix
outputStreamcreating a newStreamControlleron every access. - Fix error handler double-reporting errors as both Object and String.
- Deprecate non-async
SOCKSSocket()constructor (causesLateInitializationError); useSOCKSSocket.create(). - Fix broadcast stream subscription race during handshake via Completer-based approach.
Features #
- Configurable
handshakeTimeoutandoperationTimeoutoncreate()(default 30s). write()newline option for line-delimited protocols.ConnectionStateenum (disconnected, connecting, connected, error).reconnect()to re-establish a dropped connection without creating a new instance.
1.1.1 #
- Example fixes only.
1.1.0 #
- Add
inputStreamandoutputStream.
1.0.0 #
- Dart & Flutter 3.
- Supports SOCKS version 5 protocol.
- SSL support.
- Supports ElectrumX and Fulcrum servers via socket(s).
- Async support for non-blocking network communication.
- Lightweight and minimal dependencies.
- Working example.