Implemented proxy spec and useragent spoofing

This commit is contained in:
Luxferre
2024-10-22 20:11:33 +03:00
parent 20b522d18d
commit 4453ed575a
4 changed files with 54 additions and 11 deletions
+16 -1
View File
@@ -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]