您好,我需要连接到 http 而没有安全问题... 这是链接 http://audior.ec/recordmp3js/ 用 chrome 打开时会显示问题,但用 firefox
则不会browser.Source = "http://audior.ec/recordmp3js/";
如果它在“firefox”上运行,这是来自网站的日志: 音频上下文设置。 navigator.getUserMedia 可用。 已创建媒体流。 输入采样率 48000 输入连接到音频上下文目标。 录音机初始化。
如果不能使用“chrome”,这一个:
No live audio input: SecurityError: Only secure origins are allowed (see: https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features).
最佳答案
正如 chrome 所说:
No live audio input: SecurityError: Only secure origins are allowed (see: https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features).
这意味着当您想在 chrome 中使用麦克风时,您需要安全的 https
连接。
这是一项需要在您的服务器上实现的安全措施。
您可以使用证书颁发机构获取证书(如 Lets Encrypt(免费))或使用自签名证书。虽然后者可能不起作用,因为它并不总是被认为是安全的
它在 firefox 中工作的原因是因为他们似乎没有选择这样的限制。这在未来可能会改变。
WebView
New Webviews also share the same rendering engine as Chrome for Android, so rendering should be much more consistent between the WebView and Chrome.
参见 Android Webview .我很确定 Xamarin 使用此实现。
安全来源
在撰写本文时,这些被认为是安全来源(参见链接)
“Secure origins” are origins that match at least one of the following (scheme, host, port) patterns:
(https, *, *)
(wss, *, *)
(*, localhost, *)
(*, 127/8, *)
(*, ::1/128, *)
(file, *, —)
(chrome-extension, *, —)
关于c# - xamarin 表单 - webview 不安全连接 http,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50887049/