mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-11-22 00:05:57 -05:00
responses can now expose the IP address used to connect to the peer server to fetch the response from.
61 lines
1.1 KiB
Plaintext
61 lines
1.1 KiB
Plaintext
module HTTPX
|
|
class TCP
|
|
include Loggable
|
|
|
|
attr_reader ip: ipaddr?
|
|
|
|
attr_reader port: Integer
|
|
|
|
attr_reader addresses: Array[ipaddr]
|
|
|
|
attr_reader state: Symbol
|
|
|
|
attr_reader interests: io_interests
|
|
|
|
alias host ip
|
|
|
|
# TODO: lift when https://github.com/ruby/rbs/issues/1497 fixed
|
|
def initialize: (URI::Generic origin, Array[ipaddr]? addresses, options options) ?{ (self) -> void } -> void
|
|
|
|
def add_addresses: (Array[ipaddr] addrs) -> void
|
|
|
|
def to_io: () -> ::IO
|
|
|
|
def protocol: () -> String
|
|
|
|
def connect: () -> void
|
|
|
|
private
|
|
|
|
# :nocov:
|
|
def try_connect: () -> void
|
|
|
|
public
|
|
|
|
def read: (Integer size, ?(Buffer | String) buffer) -> (0 | nil | untyped)
|
|
|
|
def write: (Buffer buffer) -> Integer?
|
|
|
|
def close: () -> void
|
|
|
|
def connected?: () -> bool
|
|
|
|
def expired?: () -> boolish
|
|
|
|
def closed?: () -> bool
|
|
|
|
# :nocov:
|
|
def inspect: () -> ::String
|
|
|
|
private
|
|
|
|
def build_socket: () -> Socket
|
|
|
|
def transition: (Symbol nextstate) -> void
|
|
|
|
def do_transition: (Symbol nextstate) -> void
|
|
|
|
def log_transition_state: (Symbol nextstate) -> void
|
|
end
|
|
end
|