class SOCKS::Client

Defined in:

socks/client.cr

Constructors

Instance Method Summary

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) #

[View source]
def self.new(outbound : IO, dnsResolver : DNS::Resolver, options : Options) #

[View source]
def self.new(ip_address : Socket::IPAddress, dns_resolver : DNS::Resolver, options : Options, timeout : TimeOut = TimeOut.new) #

[View source]

Instance Method Detail

def associate_udp_timeout #

[View source]
def associate_udp_timeout=(value : TimeOut) #

[View source]
def authenticate_frame : SOCKS::Frames::Authenticate? #

[View source]
def authenticate_frame=(value : Frames::Authenticate) #

[View source]
def authentication_methods #

[View source]
def authentication_methods=(value : Array(Frames::AuthenticationFlag)) #

[View source]
def authentication_methods=(value : Set(Frames::AuthenticationFlag)) #

[View source]
def authentication_methods=(value : Frames::AuthenticationFlag) #

[View source]
def close #
Description copied from class IO

Closes this IO.

IO defines this is a no-op method, but including types may override.


[View source]
def closed? #
Description copied from class IO

Returns true if this IO is closed.

IO defines returns false, but including types may override.


[View source]
def connection_identifier : UUID? #

[View source]
def connection_identifier=(value : UUID) #

[View source]
def connection_pause_pending=(value : Bool | Nil) #

[View source]
def connection_pause_pending? : Bool | Nil #

[View source]
def dnsResolver : DNS::Resolver #

[View source]
def establish!(command_type : Frames::CommandFlag, host : String, port : Int32, remote_dns_resolution : Bool = true) #

[View source]
def establish!(command_type : Frames::CommandFlag, destination_address : Socket::IPAddress | Address, remote_dns_resolution : Bool = true) #

[View source]
def exchangeFrames : Set(Frames) #

[View source]
def exchangeFrames=(exchangeFrames : Set(Frames)) #

[View source]
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.


[View source]
def handshake! : Bool #

[View source]
def holding : IO | Nil #

[View source]
def holding=(holding : IO | Nil) #

[View source]
def local_address : Socket::Address | Nil #

[View source]
def notify_peer_incoming #

[View source]
def notify_peer_negotiate(source : IO, command_flag : SOCKS::Enhanced::CommandFlag = SOCKS::Enhanced::CommandFlag::CONNECTION_REUSE) : SOCKS::Enhanced::CommandFlag | Nil #

[View source]
def options : Options #

[View source]
def outbound : IO #

[View source]
def process_upgrade!(state : SOCKS::Enhanced::State | Nil = nil) #

[View source]
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

[View source]
def read_timeout #

[View source]
def read_timeout=(value : Int | Time::Span | Nil) #

[View source]
def remote_address : Socket::Address | Nil #

[View source]
def reset_socket : Bool #

[View source]
def tcp_binding_timeout #

[View source]
def tcp_binding_timeout=(value : TimeOut) #

[View source]
def update_receive_rescue_buffer(slice : Bytes) #

[View source]
def version #

[View source]
def version=(value : Frames::VersionFlag) #

[View source]
def wrapper_authorization : SOCKS::Frames::WebSocketAuthorizationFlag? #

[View source]
def wrapper_authorization=(value : Frames::WebSocketAuthorizationFlag) #

[View source]
def wrapper_authorize_frame : SOCKS::Frames::Authorize? #

[View source]
def wrapper_authorize_frame=(value : Frames::Authorize) #

[View source]
def write(slice : Bytes) : Nil #
Description copied from class IO

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"

[View source]
def write_timeout #

[View source]
def write_timeout=(value : Int | Time::Span | Nil) #

[View source]