32 #include <boost/asio/ip/tcp.hpp> 33 #include <boost/asio/io_service.hpp> 34 #include <boost/asio/strand.hpp> 35 #include <boost/system/error_code.hpp> 36 #include <boost/type_traits/integral_constant.hpp> 37 #include <boost/utility/string_ref.hpp> 48 class ipv4_network_address;
96 boost::asio::io_service::strand strand_;
112 virtual void done(boost::system::error_code
error, std::shared_ptr<client>
self) = 0;
145 return {buffer_, buffer_size_};
180 static bool connect_and_send(std::shared_ptr<client>
self,
const stream_type::endpoint& proxy_address);
195 static bool send(std::shared_ptr<client>
self);
202 void operator()(boost::system::error_code
error = boost::system::error_code{});
206 template<
typename Handler>
211 virtual void done(boost::system::error_code
error, std::shared_ptr<client>)
override 224 template<
typename Handler>
225 inline std::shared_ptr<client>
228 return std::make_shared<connect_client<Handler>>(
std::move(proxy), ver,
std::move(handler));
std::error_category const & error_category() noexcept
epee::span< const std::uint8_t > buffer() const noexcept
socks::version socks_version() const noexcept
static bool connect_and_send(std::shared_ptr< client > self, const stream_type::endpoint &proxy_address)
b32 i2p address; internal format not condensed/decoded.
bool set_resolve_command(boost::string_ref domain)
Try to set domain as remote DNS A record lookup request.
std::unique_ptr< void, close > socket
Unique ZMQ socket handle, calls zmq_close on destruction.
void clear_command() noexcept
std::shared_ptr< client > make_connect_client(client::stream_type::socket &&proxy, socks::version ver, Handler handler)
stream_type::socket take_socket()
Extensions defined in Tor codebase.
bool_constant< true > true_type
boost::asio::ip::tcp stream_type
bool set_connect_command(const epee::net_utils::ipv4_network_address &address)
Try to set address as remote connection request.
void operator()(boost::system::error_code error=boost::system::error_code{})
virtual ~connect_client() override
std::shared_ptr< client > self_
version
Supported socks variants.
boost::endian::big_uint16_t port
Client support for socks connect and resolve commands.
boost::system::error_code make_error_code(error value) noexcept
error
Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4.protocol.
const T & move(const T &t)
Tor onion address; internal format not condensed/decoded.
client & operator=(const client &)=delete
client(stream_type::socket &&proxy, socks::version ver)
const GenericPointer< typename T::ValueType > T2 value
const boost::system::error_category & error_category() noexcept
connect_client(stream_type::socket &&proxy, socks::version ver, Handler &&handler)
static bool send(std::shared_ptr< client > self)