ying lcs wrote:
Thanks for all the help. One more question (hopefully the last), is it possible for me to link in the squidclient in my c/c++ program? I would like to do this "squidclient -H "Cache-Control: only-if-cached\n" 'http://www.freebsd.org/' | head -1 | awk '{ if ($2=="200") print "cached!"; else print "not cached"; }'" programically in my program.
While it would be possible, you might want to use functions for speaking proxy http directly instead. If you can't find any it is quite simple to generate the whole query yourself; here's an example using netcat:
echo "GET http://www.freebsd.org/ HTTP/1.0\nCache-Control: only-if-cached\n\n" | nc <proxyserver> <proxyport> | head
-- Andreas