Artifact
359a83cdd9790d483169134178217373f68b1dc5:
Attachment "leakap.tcl" to
ticket [f084c0dc03]
added by
aku
2015-10-23 21:25:07.
#!/usr/local/bin/tclsh8.6
package require http
package require autoproxy
package require tls
proc init1 {} {
set http_proxy_host "proxy"
set http_proxy_port 8118
::autoproxy::init
::http::register https 443 [list ::autoproxy::tls_socket -ssl2 0 -ssl3 0 -tls1 1]
::autoproxy::configure -proxy_host $http_proxy_host -proxy_port $http_proxy_port
}
proc init2 {} {
::http::register https 443 ::tls::socket
}
proc scrape {} {
set pageUrl "https://www.google.com/"
set fp [::http::geturl $pageUrl -timeout 10000]
set status [::http::status $fp]
set ncode [::http::ncode $fp]
set html [::http::data $fp]
array set headers [::http::meta $fp]
::http::cleanup $fp
}
init1
for {set i 0} {$i < 1000} {incr i} {
puts "request $i"
scrape
puts [exec "/bin/ps" "auxw" "-p" [pid]]
}