在 Un4Seen Bass.Net 中设置网络代理
我正在编写一个流媒体播放器,它使用 Un4Seen 的 Bass 本机音频 API 的 Bass.Net 包装器。我希望媒体播放器支持 Web 代理,这对我来说在内置 .NET Web 客户端库中设置很容易,但我找不到有关如何在 Bass.Net 中设置代理的文档 有关
如何执行此操作的任何想法?
I'm writing a streaming media player that uses the Bass.Net wrapper for Un4Seen's Bass native audio API. I want the media player to support a web proxy, which is easy enough for me to setup in the built in .NET webclient library, but I cannot find documentation on how to setup the proxy in Bass.Net
Any ideas of how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BASS_CONFIG_NET_PROXY 代理服务器设置。 newvalue (IntPtr):“用户代理”标头。
代理服务器设置,格式为“user:pass@server:port”... null = 不使用代理。 ""(空字符串)= 使用默认代理设置。如果仅指定“user:pass@”部分,则这些授权凭据将与默认代理服务器一起使用。如果仅指定“服务器:端口”部分,则无需任何授权凭据即可使用该代理服务器。
BASS 不会复制代理字符串,因此它必须驻留在堆(而不是堆栈)中,例如。全局变量 - 请参阅下面的示例!这也意味着随后可以在该位置更改代理设置,而无需再次调用此函数。
更改从下一次互联网流创建调用开始生效。默认情况下,BASS 将使用“Internet 属性”控制面板中设置的 Windows 代理设置。
从这里:http://www.bass.radio42.com/help/html/e67e2d41-ed14-19c1-b75a-48bad250f261.htm
BASS_CONFIG_NET_PROXY Proxy server settings. newvalue (IntPtr): The "User-Agent" header.
The proxy server settings, in the form of "user:pass@server:port"... null = don't use a proxy. "" (empty string) = use the default proxy settings. If only the "user:pass@" part is specified, then those authorization credentials are used with the default proxy server. If only the "server:port" part is specified, then that proxy server is used without any authorization credentials.
BASS does not make a copy of the proxy string, so it must reside in the heap (not the stack), eg. a global variable - see example below! This also means that the proxy setting can subsequently be changed at that location without having to call this function again.
Changes take effect from the next internet stream creation call. By default, BASS will use the Windows proxy settings, as set in the Internet Properties control panel.
From here: http://www.bass.radio42.com/help/html/e67e2d41-ed14-19c1-b75a-48bad250f261.htm