更新时间:2022-06-27 05:54:11
你不能把它实现为 servlet,也没有理由使用任何形式的 HTTP 客户端.
You can't implement it as a servlet, and there is no reason to use any form of HTTP client.
无功能的代理服务器是一件非常简单的事情:
A featureless proxy server is a really simple thing:
否则启动两个线程来复制字节,每个方向一个.没什么好看的,就是
Otherwise start two threads to copy bytes, one in each direction. Nothing fancy, just
while ((count = in.read(buffer)) > 0)
{
out.write(buffer, 0, count);
}
或者使用 Apache SQUID.
Or use Apache SQUID.