Skip to content

Commit 1c74057

Browse files
committed
Rename start_transparent_proxy to setup_tproxy
1 parent d1d97b3 commit 1c74057

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

proxy/include/proxy/proxy_server.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ R"x*x*x(<html>
582582
virtual ~proxy_session_base() {}
583583
virtual void start() = 0;
584584
virtual void close() = 0;
585-
virtual void set_tproxy_remote(const net::ip::tcp::endpoint&) = 0;
585+
virtual void setup_tproxy(const net::ip::tcp::endpoint&) = 0;
586586
virtual size_t connection_id() = 0;
587587
};
588588

@@ -879,9 +879,12 @@ R"x*x*x(<html>
879879
m_remote_socket.close(ignore_ec);
880880
}
881881

882-
void set_tproxy_remote(
882+
void setup_tproxy(
883883
const net::ip::tcp::endpoint& tproxy_remote) override
884884
{
885+
log_conn_debug()
886+
<< ", tproxy setup: " << tproxy_remote;
887+
885888
m_tproxy_remote = tproxy_remote;
886889
}
887890

@@ -5520,7 +5523,7 @@ R"x*x*x(<html>
55205523
#if defined (__linux__)
55215524
std::optional<net::ip::tcp::endpoint> tproxy_endpoint;
55225525
if (m_option.transparent_)
5523-
tproxy_endpoint = co_await start_transparent_proxy(socket, connection_id);
5526+
tproxy_endpoint = co_await setup_tproxy(socket, connection_id);
55245527
#endif
55255528

55265529
// 在启用 scramble 时, 刻意开启 Nagle's algorithm 以尽量保证数据包
@@ -5547,7 +5550,7 @@ R"x*x*x(<html>
55475550

55485551
#if defined (__linux__)
55495552
if (tproxy_endpoint)
5550-
new_session->set_tproxy_remote(*tproxy_endpoint);
5553+
new_session->setup_tproxy(*tproxy_endpoint);
55515554
#endif
55525555

55535556
// 启动 proxy_session 对象.
@@ -5559,7 +5562,7 @@ R"x*x*x(<html>
55595562
}
55605563

55615564
inline net::awaitable<std::optional<net::ip::tcp::endpoint>>
5562-
start_transparent_proxy(proxy_tcp_socket& socket, size_t connection_id) noexcept
5565+
setup_tproxy(proxy_tcp_socket& socket, size_t connection_id) noexcept
55635566
{
55645567
#ifndef SO_ORIGINAL_DST
55655568
# define SO_ORIGINAL_DST 80

0 commit comments

Comments
 (0)