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));
b32 i2p address; internal format not condensed/decoded.
Client support for socks connect and resolve commands.
epee::span< const std::uint8_t > buffer() const noexcept
void clear_command() noexcept
boost::asio::ip::tcp stream_type
client(const client &)=delete
stream_type::socket take_socket()
bool set_resolve_command(boost::string_ref domain)
Try to set domain as remote DNS A record lookup request.
bool set_connect_command(const epee::net_utils::ipv4_network_address &address)
Try to set address as remote connection request.
static bool connect_and_send(std::shared_ptr< client > self, const stream_type::endpoint &proxy_address)
client & operator=(const client &)=delete
client(stream_type::socket &&proxy, socks::version ver)
static bool send(std::shared_ptr< client > self)
socks::version socks_version() const noexcept
connect_client(stream_type::socket &&proxy, socks::version ver, Handler &&handler)
virtual ~connect_client() override
Tor onion address; internal format not condensed/decoded.
Concept for receiving events from GenericReader upon parsing. The functions return true if no error o...
std::error_category const & error_category() noexcept
const boost::system::error_category & error_category() noexcept
error
Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4....
version
Supported socks variants.
@ v4a_tor
Extensions defined in Tor codebase.
std::shared_ptr< client > make_connect_client(client::stream_type::socket &&proxy, socks::version ver, Handler handler)
boost::system::error_code make_error_code(error value) noexcept
std::unique_ptr< void, close > socket
Unique ZMQ socket handle, calls zmq_close on destruction.
bool_constant< true > true_type
const T & move(const T &t)
const GenericPointer< typename T::ValueType > T2 value
boost::endian::big_uint16_t port
void operator()(boost::system::error_code error=boost::system::error_code{})
std::shared_ptr< client > self_