It is possible, albeit a little tricky.
when HTTP_REQUEST {
set http_host [HTTP::host]
set http_uri [HTTP::uri]
eval "set temp \"[string map {"\"" "\\\""} [ifile get down.html]]\""
HTTP::respond 200 content $temp
}
You can also just do:
HTTP::respond 200 content [eval "set temp \"[string map {"\"" "\\\""} [ifile get down.html]]\""]
You can use local variables and commands (ie. [HTTP::host]) inside the HTML files as well. Essentially what you're doing is assigning the contents of the HTML file to a local variable, encapsulating the whole thing in quotation marks to make it one long string, replacing all of the internal quotation marks with escaped quotation marks, and then evaluating the new string to replace all of the inline variables and commands. You have to be careful of course that you don't have any TCL errors in your HTML, as that'll be a little less forgiving in the troubleshooting department. Also, if you have any other special characters in your HTML, like the square brackets, you'll need to escape them too.