إجبار YouTube على أن يتم تخزينه مؤقتًا من خلال cache_peer في الحبار

StackOverflow https://stackoverflow.com/questions/19847619

  •  29-07-2022
  •  | 
  •  

سؤال

أرغب في إجبار وكيل الحبار على استخدام شكل نظير ذاكرة التخزين المؤقت الوكيل كل ما يتعلق بـ YouTube.

خادم الحبار الرئيسي الخاص بي على الخادم A ، إنه إعداد بسيط حقًا ، بدون قواعد تقريبًا ، كل شيء مصرح به.

يتم ربط الخادم A بالخادم B عبر OpenVPN. يحتوي الخادم B أيضًا على وكيل Squid Wele ويعمل بشكل جيد (تم اختباره باستخدام SSH Tunnel ، لا مشكلة).

على خادم الذكاء الاصطناعى أضافت قواعد الأطروحات:

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