#pragma once
#include "common.hpp"
#include "chain.hpp"
#include "sock.hpp"
#include "ssl_common.hpp"
/// Reads from fd and checks whether all available data is already some kind of
/// proxy request, so we know where to connect to in case of a direct/local
/// connection. Upon success, the client gets acknowledged s.t. the next data to
/// be expected is the ssl client helo.
/// As a bonus, some hostname might be derivable, s.t. no SNI sniffing is needed
/// afterwards.
/// Currently supported: socks4, HTTP CONNECT
/// Note that upon failure, no fallback should be taken, as we might already did
/// some i/o on the socket.
bool handle_proxy_request(int, sockaddr_t&, char*&);