Successful connection using Connect() overload for proxy
Some checks failed
PR Check / on-push-commit-check (push) Failing after 11m48s

This commit is contained in:
sectapunterx 2024-11-23 20:22:21 +03:00
parent d4e78e63b2
commit 5d64a8ca26

View file

@ -296,8 +296,6 @@ template <typename Socket, typename ProxyType>
auto ConnectToServer(Socket& socket, const ProxyType& proxy, std::string_view host, std::uint16_t port) -> boost::asio::awaitable<void> { auto ConnectToServer(Socket& socket, const ProxyType& proxy, std::string_view host, std::uint16_t port) -> boost::asio::awaitable<void> {
auto executor = co_await boost::asio::this_coro::executor; auto executor = co_await boost::asio::this_coro::executor;
boost::asio::ip::tcp::resolver resolver(executor); boost::asio::ip::tcp::resolver resolver(executor);
// auto endpoints = co_await resolver.async_resolve(proxy.hostname, std::to_string(proxy.port), boost::asio::use_awaitable);
// co_await boost::asio::async_connect(socket, endpoints, boost::asio::use_awaitable);
if constexpr(!std::same_as<ProxyType, NoProxy>) { if constexpr(!std::same_as<ProxyType, NoProxy>) {
auto endpoints = co_await resolver.async_resolve(proxy.hostname, std::to_string(proxy.port), boost::asio::use_awaitable); auto endpoints = co_await resolver.async_resolve(proxy.hostname, std::to_string(proxy.port), boost::asio::use_awaitable);