Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
squid.doc
Скачиваний:
9
Добавлен:
01.05.2025
Размер:
1 Мб
Скачать
☆

7.4 Как я могу проксировать/кешировать Real Audio?

от Rodney van den Oever, и James R Grinter

  • Установите RealPlayer на использование HTTP-порта вашего сервера Squid (3128).

  • Перейдите в закладку Preferences->Transport, выберите Use specified transports и используя копку Specified Transports, выберите использовать HTTP Only.

В руководстве по RealPlayer (и RealPlayer Plus) сказано:

Use HTTP Only

Select this option if you are behind a firewall and cannot

receive data through TCP. All data will be streamed through

HTTP.

Note: You may not be able to receive some content if you select

this option.

Снова из документации:

RealPlayer 4.0 identifies itself to the firewall when making a

request for content to a RealServer. The following string is

attached to any URL that the Player requests using HTTP GET:

/SmpDsBhgRl

Thus, to identify an HTTP GET request from the RealPlayer, look

for:

http://[^/]+/SmpDsBhgRl

The Player can also be identified by the mime type in a POST to

the RealServer. The RealPlayer POST has the following mime

type:

"application/x-pncmd"

Note that the first request is a POST, and the second has a '?' in the URL, so standard Squid configurations would treat it as non-cachable. It also looks rather ``magic.''

HTTP is an alternative delivery mechanism introduced with version 3 players, and it allows a reasonable approximation to ``streaming'' data - that is playing it as you receive it. For more details, see their notes on HTTP Pseudo-Streaming.

It isn't available in the general case: only if someone has made the realaudio file available via an HTTP server, or they're using a version 4 server, they've switched it on, and you're using a version 4 client. If someone has made the file available via their HTTP server, then it'll be cachable. Otherwise, it won't be (as far as we can tell.)

The more common RealAudio link connects via their own pnm: method and is transferred using their proprietary protocol (via TCP or UDP) and not using HTTP. It can't be cached nor proxied by Squid, and requires something such as the simple proxy that Progressive Networks themselves have made available, if you're in a firewall/no direct route situation. Their product does not cache (and I don't know of any software available that does.)

Some confusion arises because there is also a configuration option to use an HTTP proxy (such as Squid) with the Realaudio/RealVideo players. This is because the players can fetch the ``.ram'' file that contains the pnm:reference for the audio/video stream. They fetch that .ram file from an HTTP server, using HTTP.

7.5 Как мне удалить объект из кеша?

Squid не позволит удалить вам объект до тех пор, пока вы не настроите контроль доступа в squid.conf. Во-первых вам необходимо добавить следующее:

acl PURGE method PURGE

acl localhost src 127.0.0.1

http_access allow PURGE localhost

http_access deny PURGE

Указанное выше разрешает запросы удаления с локального хоста и запрещает все остальные запросы удаления.

Чтобы удалить объект воспользуйтесь программой client:

client -m PURGE http://www.miscreant.com/

Если удаление прошло успешно вы увидите сообщение ``200 OK'':

HTTP/1.0 200 OK

Date: Thu, 17 Jul 1997 16:03:32 GMT

Server: Squid/1.1.14

Если объект в кеше не найден вы получите сообщение ``404 Not Found'':

HTTP/1.0 404 Not Found

Date: Thu, 17 Jul 1997 16:03:22 GMT

Server: Squid/1.1.14

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]