主动反向代理

发布于 2024-07-07 07:58:35 字数 163 浏览 9 评论 0原文

有谁知道任何反向代理解决方案允许在转发到请求客户端之前直接修改 HTTP 响应的内容/数据?

举个例子:

代理将客户端对 pdf 文档的请求中继到另一台服务器,代理收到响应,将水印添加到 pdf 页面,带水印的 pdf 返回给客户端。

问候, 麦克风

Does anyone know of any reverse proxy solutions that allow the content/data of an HTTP response to be directly modified before being relayed to the requesting client?

As an example:

Proxy relays client request for pdf document to another server, response received by proxy, watermark added to pages of pdf, watermarked pdf is returned to client.

Regards,
Mike

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

慕烟庭风 2024-07-14 07:58:35

Apache 有 mod_proxymod_proxy_html,用于重写链接、标题等。我只见过 HTML 或 XML 过滤器,但您应该能够编写自己的二进制过滤器来满足您的 PDF 需求。 我发现的可能的困难是 Apache 将网页视为流,而不是文件。 我不确定如何为 PDF 文档添加水印,但如果您需要访问整个文件来执行此操作,它可能很快就会变得复杂。

请注意,对我来说,在服务器上添加水印似乎要容易得多,您可以在服务器上访问文件,而不是在代理上。 如果服务器负载是一个问题,则批处理或单独的服务器可能是替代解决方案。

Apache has mod_proxy and mod_proxy_html, which is used to rewrite links, headers, etc. I've only ever seen HTML or XML filters, but you should be able to write your own binary one for your PDF needs. The possible difficulty I could see is that Apache treats webpages as a stream, rather than a file. I'm not sure how to watermark a PDF doc, but if you need access to the entire file to do it, it might get complicated quickly.

Note that it would seem far easier to me to do the watermarking on the server, where you have access to the file, rather than a proxy. If server load is a concern, either a batch process, or a separate server could be an alternative solution.

酒解孤独 2024-07-14 07:58:35

我在 python 标签上找到了 Deliverance 的描述,它可能对你在寻找什么。 我自己没有这方面的经验,所以持保留态度。

http://www.openplans.org/projects/deliverance/introduction

I found a description of Deliverance over on the python tags, and it may be useful for what you're looking for. I have no experience with it myself, so grain of salt and all that.

http://www.openplans.org/projects/deliverance/introduction

木槿暧夏七纪年 2024-07-14 07:58:35

我在英镑方面取得了成功。

I've had success with Pound.

醉生梦死 2024-07-14 07:58:35

我想我可能会走 Squid/ICAP 路线。

这是针对企业级系统的,有人在这方面有这方面的经验吗?

http://wiki.squid-cache.org/Features/ICAP

I think I might go down the Squid/ICAP route.

This is for an enterprise level system, does anyone have any experience with either of these in this context?

http://wiki.squid-cache.org/Features/ICAP

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文