fix(proxy): improve DNS handling and CONNECT tunneling - #898
Merged
Merged
Conversation
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HttpHandlerhostname targets asynchronously throughEventLoop::resolveDns, preserving the numeric-IP fast path and TLS SNIproxy_connect_timeoutbudgettinyproxyd, including authority parsing and bounds checksScope
The fixed-upstream library functions
hloop_create_tcp_proxy_serverandhloop_create_udp_proxy_serverare unchanged; the example programs resolve their fixed targets before starting the loop.tinyproxydremains a demo and still uses its existing socket creation path for ordinary dynamic targets.Verification
hdns_testwithMallocScribble=1andMallocErrorAbort=1lua_io_test,lua_http_test, andlua_mqtt_testteardown coverage200in about 0.54s)504in about 1.51s while/pingon the same worker remains responsivelocalhosttargetlocalhosttargetHttpHandlerforward-proxy hostname round triptinyproxydCONNECT tunnels with numeric-IP and hostname authoritiestinyproxydordinary HTTP proxy regressiongit diff --check