Skip to content
Tcl Source Code Artifact [8c5b296297]
Login

Artifact [8c5b296297]

Artifact 8c5b29629756779fe64ab9e9f38b8f81913cbe12c1be61802113bb7fb6d502dd:

Ticket change [8c5b296297] - New ticket [a976e76bafee1943|a976e76baf] <i>http: endToEndProxy without useSockThread bypasses the proxy</i>. by serhiy.storchaka on 2026-10-14 13:42:29.
D 2026-10-14T13:42:29.293
J cmimetype text/x-fossil-wiki
J comment <nowiki>[http::register]</nowiki>\sdocuments\s<i>useSockThread</i>\sand\s<i>endToEndProxy</i>\sas\sindependent\soptions,\sbut\s<i>endToEndProxy</i>\sonly\sworks\swhen\s<i>useSockThread</i>\sis\salso\strue.\sOtherwise\sthe\srequest\sdoes\snot\sgo\sthrough\sthe\sconfigured\sproxy\sat\sall:\shttp\sconnects\sdirectly\sto\sthe\starget\sserver.\n\n<verbatim>\npackage\srequire\shttp\nnamespace\seval\smy\s{variable\ssocketCmd\s::socket}\nproc\smysock\s{args}\s{puts\s"openCmd:\s$args";\s$::my::socketCmd\s{*}$args}\nhttp::register\sxs\s443\smysock\s::my::socketCmd\s0\s1\nhttp::config\s-proxyhost\s127.0.0.1\s-proxyport\s3128\nhttp::geturl\sxs://example.invalid/\n</verbatim>\n\nThis\sprints\s<tt>openCmd:\s-async\sexample.invalid\s443</tt>\sand\sfails\swith\s<tt>couldn't\sopen\ssocket:\sName\sor\sservice\snot\sknown</tt>:\sit\stries\sto\sconnect\sto\sthe\starget\shost\sdirectly\sinstead\sof\sto\sthe\sproxy.\sWith\s<tt>...\s::my::socketCmd\s1\s1</tt>\sit\ssends\s<tt>CONNECT\sexample.invalid:443</tt>\sto\sthe\sproxy\sas\sexpected.\n\nThe\scause:\shttp::geturl\spasses\s<tt>-type\s$token</tt>\sto\sthe\ssocket\scommand\sonly\sif\s<i>useSockThread</i>\sis\strue\s(library/http/http.tcl,\s<tt>if\s{$useSockThread}</tt>\sbefore\s<tt>set\sstate(openCmd)</tt>).\sWithout\sthe\stoken,\shttp::socketAsCallback\scannot\ssee\sstate(protoProxyConn),\streats\sthe\sconnection\sas\snot\sproxied\sand\scalls\shttp::AltSocket.
J foundin 9.0.5,\s9.1.0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter serhiy.storchaka
J subsystem 29.\shttp\sPackage
J title http:\sendToEndProxy\swithout\suseSockThread\sbypasses\sthe\sproxy
J type Bug
K a976e76bafee1943af1045e0f7d8b87b72afece3
U serhiy.storchaka
Z bd552c393b8a6a0d9233c5084cd179ca