SOCKS::Client
Inherits IO < Reference < Object
Constructors
new(host : String, port : Int32, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new)
SourceInstance methods
__transfer_before_call
Source__transfer_extra_received_bytes
Source__transfer_extra_sent_bytes
Sourceauthenticate_frame
Sourceauthenticate_frame=(value : Frames::Authenticate)
Sourceauthentication_methods
Sourceauthentication_methods=(value : Array(Frames::AuthenticationFlag))
Sourceauthentication_methods=(value : Set(Frames::AuthenticationFlag))
Sourceauthentication_methods=(value : Frames::AuthenticationFlag)
Sourceclose_forwarder(reset : Bool = true)
Sourceclosed?
Returns true if this IO is closed.
IO defines returns false, but including types may override.
connection_identifier
Sourceconnection_identifier=(value : UUID)
Sourceconnection_pause_pending=(value : Bool | Nil)
Sourceconnection_pause_pending?
Sourceestablish!(dns_resolver : DNS::Resolver, command_flag : Frames::CommandFlag, host : String, port : Int32, remote_dns_resolution : Bool = true)
Sourceestablish!(dns_resolver : DNS::Resolver, command_flag : Frames::CommandFlag, destination_address : Socket::IPAddress | Address, remote_dns_resolution : Bool = true) : Frames::Establish | Nil
Sourceflush
Flushes buffered data, if any.
IO defines this is a no-op method, but including types may override.
handshake!
Sourcelast_alive_time
Sourcenotify_peer_incoming
Sourcenotify_peer_negotiate(source : IO, command_flag : SOCKS::Enhanced::CommandFlag | Nil = nil) : SOCKS::Enhanced::CommandFlag | Nil
Sourceoptions
Sourceoutbound
Sourceread(slice : Bytes) : Int32
Reads at most slice.size bytes from this IO into slice.
Returns the number of bytes read, which is 0 if and only if there is no
more data to read (so checking for 0 is the way to detect end of file).
io = IO::Memory.new "hello"
slice = Bytes.new(4)
io.read(slice) # => 4
slice # => Bytes[104, 101, 108, 108]
io.read(slice) # => 1
slice # => Bytes[111, 101, 108, 108]
io.read(slice) # => 0
resynchronize(command_flag : Frames::CommandFlag) : Frames::Establish | Nil
Sourcetcp_forwarder
SourcetcpForwarder
SourcetcpForwarder=(tcpForwarder : Layer::TCPBinding | Nil)
Sourceudp_forwarder
SourceudpForwarder
SourceudpForwarder=(udpForwarder : Layer::AssociateUDP | Nil)
Sourceversion
Sourceversion=(value : Frames::VersionFlag)
Sourcewrapper
Sourcewrapper=(value : Options::Client::Wrapper)
Sourcewrapper_authorize
Sourcewrapper_authorize=(value : Frames::Authorize)
Sourcewrite(slice : Bytes) : Nil
Writes the contents of slice into this IO.
io = IO::Memory.new
slice = Bytes.new(4) { |i| ('a'.ord + i).to_u8 }
io.write(slice)
io.to_s # => "abcd"