Skip to content
Tcl Source Code History Of Ticket a976e76ba
Login

History Of Ticket a976e76ba

Artifacts Associated With Ticket a976e76ba

  1. Ticket change [8c5b296297] (rid 258000) by serhiy.storchaka on 2026-10-14 13:42:29:

    1. cmimetype initialized to: "text/x-fossil-wiki"
    2. comment initialized to:
      <nowiki>[http::register]</nowiki> documents <i>useSockThread</i> and <i>endToEndProxy</i> as independent options, but <i>endToEndProxy</i> only works when <i>useSockThread</i> is also true. Otherwise the request does not go through the configured proxy at all: http connects directly to the target server.
      
      <verbatim>
      package require http
      namespace eval my {variable socketCmd ::socket}
      proc mysock {args} {puts "openCmd: $args"; $::my::socketCmd {*}$args}
      http::register xs 443 mysock ::my::socketCmd 0 1
      http::config -proxyhost 127.0.0.1 -proxyport 3128
      http::geturl xs://example.invalid/
      </verbatim>
      
      This prints <tt>openCmd: -async example.invalid 443</tt> and fails with <tt>couldn't open socket: Name or service not known</tt>: it tries to connect to the target host directly instead of to the proxy. With <tt>... ::my::socketCmd 1 1</tt> it sends <tt>CONNECT example.invalid:443</tt> to the proxy as expected.
      
      The cause: http::geturl passes <tt>-type $token</tt> to the socket command only if <i>useSockThread</i> is true (library/http/http.tcl, <tt>if {$useSockThread}</tt> before <tt>set state(openCmd)</tt>). Without the token, http::socketAsCallback cannot see state(protoProxyConn), treats the connection as not proxied and calls http::AltSocket.
      
    3. foundin initialized to: "9.0.5, 9.1.0"
    4. login: "serhiy.storchaka"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. severity initialized to: "Important"
    8. status initialized to: "Open"
    9. submitter initialized to: "serhiy.storchaka"
    10. subsystem initialized to: "29. http Package"
    11. title initialized to:
      http: endToEndProxy without useSockThread bypasses the proxy
      
    12. type initialized to: "Bug"