Implemented proxy spec and useragent spoofing
This commit is contained in:
+16
-1
@@ -294,8 +294,23 @@ set appdir [file dirname $scriptpath]
|
||||
if [string match *app-tiifetch $appdir] {
|
||||
set appdir [file normalize [file join $appdir ".." ".." ".." ]]
|
||||
}
|
||||
|
||||
set localdbdir [file join $appdir "tiidb"]
|
||||
|
||||
# populate general HTTP configuration
|
||||
set cfgfile [file join $appdir "config.txt"]
|
||||
if {[file exists $cfgfile]} {
|
||||
set cfg [readfile $cfgfile]
|
||||
if {[dict exists $cfg useragent]} {
|
||||
::http::config -useragent [dict get $cfg useragent]
|
||||
}
|
||||
if {[dict exists $cfg proxyhost]} {
|
||||
::http::config -proxyhost [dict get $cfg proxyhost]
|
||||
}
|
||||
if {[dict exists $cfg proxyport]} {
|
||||
::http::config -proxyport [dict get $cfg proxyport]
|
||||
}
|
||||
}
|
||||
|
||||
if {$argc > 0} {
|
||||
if {$argc > 2} {
|
||||
set localdbdir [lindex $argv 2]
|
||||
|
||||
Reference in New Issue
Block a user