使用 Squid 按需将文本附加到 HTTP 响应
我正在尝试设置一个 http 代理,但遗憾的是我真的不知道我在做什么。
该代理的主要功能是,如果查询字符串中存在某个参数,则将 javascript 文件附加到任何 Web 请求的底部。
例如,如果我将 Firefox 设置为通过代理,如果我访问 http://www. anypage.com/?enable_script=true 以下行将出现在源代码的底部:
<script type="text/javascript" src="http://localhost/script.js"></script>
我用 Squid 玩了一下,它似乎能够做我需要的事情,但文档有限,我不知道从哪里开始。
谢谢!
I am trying to setup a http proxy, but sadly I don't really know what I'm doing.
The primary function of this proxy will be to append a javascript file to the bottom of any web request if a certain parameter is present in the Query String.
For example, if I had Firefox setup to go through the proxy, if i went to http://www.anypage.com/?enable_script=true the following line would be present at the bottom of the source:
<script type="text/javascript" src="http://localhost/script.js"></script>
I have played aroudn with Squid a little, it appears to be able to do what I need but documentation is limited and I'm not sure where to start.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该首先阅读http://wiki.squid-cache.org/SquidFaq/ContentAdaptation
You should start by reading http://wiki.squid-cache.org/SquidFaq/ContentAdaptation