Created
October 23, 2015 17:55
-
-
Save bovine/fccfb2b8c546d5f64581 to your computer and use it in GitHub Desktop.
Test case for Tcllib bug reported at http://core.tcl.tk/tcllib/tktview/f084c0dc03bd57d142bce1703cc5bdd9beb88247
This file contains 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
#!/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]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment