Compartir a través de


Basic Proxy

This section discusses how you can implement a basic proxy plug-in that does not also cache content. The Windows Media Services SDK includes a proxy plug-in as a sample. For more information, see Samples_wms_sdk_1.

The following list identifies one possible way that the server and cache proxy plug-in can interact to proxy content. The actual interaction between a server and plug-in depends on how you implement the plug-in.

  1. When a client requests digital media, the server calls QueryCache on the IWMSCacheProxy interface on the cache proxy plug-in.

  2. Because the requested content has not been cached, the plug-in can call OnQueryCache on the IWMSCacheProxyCallback interface and set the Response parameter to WMS_CACHE_QUERY_MISS.

  3. The server then calls QueryCacheMissPolicy on the IWMSCacheProxy interface.

  4. The plug-in can call GetContentInformation on the IWMSCacheProxyServer interface to request that the server connect to the origin and retrieve information about the content.

  5. The server responds by calling OnGetContentInformation on the IWMSCacheProxyServerCallback interface. If the origin server cannot be contacted, or the content is unavailable for any other reason, the cache proxy plug-in can perform protocol rollover by modifying the URL and calling GetContentInformation again.

  6. If the content is found on the origin server, the plug-in examines the content information, chooses a policy, and sends it to the server by calling the OnQueryCacheMissPolicy on the IWMSCacheProxyCallback interface. Typically, the policy will instruct the server to proxy the content as an on-demand or broadcast stream, but the plug-in can also direct the server to disconnect the client, or redirect the client to an alternate URL or proxy.

This is illustrated by the following diagram.

Illustration of the interaction between a Windows Media server and a proxy plug-in.

Dd875033.wms8_cacheplugincreate_basic_proxy_final(en-us,VS.85).gif

See Also(General)

See Also (Visual Basic .NET)

See Also (C#)

See Also (C++)

  • IWMSCacheProxy::QueryCache

  • IWMSCacheProxy::QueryCacheMissPolicy

  • IWMSCacheProxyCallback::OnQueryCache

  • IWMSCacheProxyCallback::OnQueryCacheMissPolicy

  • IWMSCacheProxyServer::GetContentInformation

  • IWMSCacheProxyServerCallback::OnGetContentInformation