我想强迫鱿鱼代理使用代理缓存对等,形成与YouTube相关的所有内容。

我的主鱿鱼服务器在服务器A上,这是一个非常简单的设置,几乎没有规则,一切都已授权。

服务器A通过OpenVPN链接到服务器B。服务器B还设置了鱿鱼代理并运行良好(使用SSH隧道进行了测试,没问题)。

在服务器AI上添加了这些规则:

acl youtube_videos_regx url_regex -i ^http://[^/]+\.youtube\.com/videoplayback\?
acl youtube_videos_regx url_regex ^http://(.*?)/get_video\?
acl youtube_videos_regx url_regex ^http://(.*?)/videodownload\?
acl youtube_videos_regx url_regex ^http://(.*?)/videoplayback\?
acl youtube_videos dstdomain .youtube.com
acl youtube_videos dstdomain .youtube-nocookie.com
acl youtube_videos dstdomain .googlevideo.com
acl youtube_videos dstdomain .ytimg.com
cache_peer 10.4.0.1 parent 3128 0 proxy-only no-query connect-timeout=5
cache_peer_access 10.4.0.1 allow youtube_videos
cache_peer_access 10.4.0.1 allow youtube_videos_regx
cache_peer_access 10.4.0.1 deny all

但这似乎不起作用:

1383861430.377    578 192.168.0.103 TCP_MISS/200 192976 GET http://r9---sn-5hn7ym7e.googlevideo.com/videoplayback? - HIER_DIRECT/208.117.250.14 application/octet-stream
1383861430.636    935 192.168.0.103 TCP_MISS/200 238032 GET http://r9---sn-5hn7ym7e.googlevideo.com/videoplayback? - HIER_DIRECT/208.117.250.14 application/octet-stream
1383861430.642   2353 192.168.0.103 TCP_MISS/200 238032 GET http://r9---sn-5hn7ym7e.googlevideo.com/videoplayback? - HIER_DIRECT/208.117.250.14 application/octet-stream
1383861432.467    617 192.168.0.103 TCP_MISS/200 192976 GET http://r9---sn-5hn7ym7e.googlevideo.com/videoplayback? - HIER_DIRECT/208.117.250.14 application/octet-stream

有时它有效:

1383860987.725    125 192.168.0.103 TCP_MISS/204 353 GET http://r20---sn-5hn7ym7r.googlevideo.com/generate_204 - FIRSTUP_PARENT/10.4.0.1 text/html

可能是因为数据类型吗?

如果是这样,我不知道要添加哪种规则。

提前致谢。

有帮助吗?

解决方案

好的,我找到了如何解决我的问题。

我只需要将其添加到我的配置文件中:

never_direct allow youtube_videos
never_direct allow youtube_videos_regx

这两条线,强迫不使用与我的2 ACL直接连接。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top