class SOCKS::Client
- SOCKS::Client
- IO
- Reference
- Object
Defined in:
socks/client.crConstructors
- .new(host : String, port : Int32, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new)
- .new(outbound : IO, dnsResolver : DNS::Resolver, options : Options)
- .new(ip_address : Socket::IPAddress, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new)
Instance Method Summary
- #associate_udp_timeout
- #associate_udp_timeout=(value : TimeOut)
- #authenticate_frame : SOCKS::Frames::Authenticate?
- #authenticate_frame=(value : Frames::Authenticate)
- #authentication_methods
- #authentication_methods=(value : Array(Frames::AuthenticationFlag))
- #authentication_methods=(value : Set(Frames::AuthenticationFlag))
- #authentication_methods=(value : Frames::AuthenticationFlag)
-
#close
Closes this
IO
. -
#closed?
Returns
true
if thisIO
is closed. - #connection_identifier : UUID?
- #connection_identifier=(value : UUID)
- #connection_pause_pending=(value : Bool | Nil)
- #connection_pause_pending? : Bool | Nil
- #dnsResolver : DNS::Resolver
- #establish!(command_type : Frames::CommandFlag, host : String, port : Int32, remote_dns_resolution : Bool = true)
- #establish!(command_type : Frames::CommandFlag, destination_address : Socket::IPAddress | Address, remote_dns_resolution : Bool = true)
- #exchangeFrames : Set(Frames)
- #exchangeFrames=(exchangeFrames : Set(Frames))
-
#flush
Flushes buffered data, if any.
- #handshake! : Bool
- #holding : IO | Nil
- #holding=(holding : IO | Nil)
- #local_address : Socket::Address | Nil
- #notify_peer_incoming
- #notify_peer_negotiate(source : IO, command_flag : SOCKS::Enhanced::CommandFlag = SOCKS::Enhanced::CommandFlag::CONNECTION_REUSE) : SOCKS::Enhanced::CommandFlag | Nil
- #options : Options
- #outbound : IO
- #process_upgrade!(state : SOCKS::Enhanced::State | Nil = nil)
-
#read(slice : Bytes) : Int32
Reads at most slice.size bytes from this
IO
into slice. - #read_timeout
- #read_timeout=(value : Int | Time::Span | Nil)
- #remote_address : Socket::Address | Nil
- #reset_socket : Bool
- #tcp_binding_timeout
- #tcp_binding_timeout=(value : TimeOut)
- #update_receive_rescue_buffer(slice : Bytes)
- #version
- #version=(value : Frames::VersionFlag)
- #wrapper_authorization : SOCKS::Frames::WebSocketAuthorizationFlag?
- #wrapper_authorization=(value : Frames::WebSocketAuthorizationFlag)
- #wrapper_authorize_frame : SOCKS::Frames::Authorize?
- #wrapper_authorize_frame=(value : Frames::Authorize)
-
#write(slice : Bytes) : Nil
Writes the contents of slice into this
IO
. - #write_timeout
- #write_timeout=(value : Int | Time::Span | Nil)
Class methods inherited from class IO
yield_copy(src : IO, dst : IO, &block : Int64, Int32 -> ) : Int64
yield_copy
Constructor Detail
def self.new(host : String, port : Int32, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new)
#
def self.new(ip_address : Socket::IPAddress, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new)
#
Instance Method Detail
def close
#
Description copied from class IO
Closes this IO
.
IO
defines this is a no-op method, but including types may override.
def closed?
#
Description copied from class IO
Returns true
if this IO
is closed.
IO
defines returns false
, but including types may override.
def establish!(command_type : Frames::CommandFlag, host : String, port : Int32, remote_dns_resolution : Bool = true)
#
def establish!(command_type : Frames::CommandFlag, destination_address : Socket::IPAddress | Address, remote_dns_resolution : Bool = true)
#
def flush
#
Description copied from class IO
Flushes buffered data, if any.
IO
defines this is a no-op method, but including types may override.
def notify_peer_negotiate(source : IO, command_flag : SOCKS::Enhanced::CommandFlag = SOCKS::Enhanced::CommandFlag::CONNECTION_REUSE) : SOCKS::Enhanced::CommandFlag | Nil
#
def read(slice : Bytes) : Int32
#
Description copied from class IO
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