Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
firefox和javascript中的WebSocket_Javascript_Google Chrome_Firefox_Websocket - Fatal编程技术网

firefox和javascript中的WebSocket

firefox和javascript中的WebSocket,javascript,google-chrome,firefox,websocket,Javascript,Google Chrome,Firefox,Websocket,我试图在带有javascript的网页中使用WebSocket,'ws://localhost:9090',但从firefox中得到以下错误: "Caught exception while dispatching event: The operation is insecure." 如果我将websocket的url更改为'wss://localhost:9090'我得到另一个错误: Firefox can't establish a connection to the server at

我试图在带有javascript的网页中使用WebSocket,'ws://localhost:9090',但从firefox中得到以下错误:

"Caught exception while dispatching event:
The operation is insecure."
如果我将websocket的url更改为'wss://localhost:9090'我得到另一个错误:

Firefox can't establish a connection to the server at wss://localhost:9090/.

我正在开发的javascript旨在与安装了ros的机器人上的ros操作系统进行通信。在这种特殊情况下如何启用WebSocket?由于firefox的限制,我使用google chrome,但在最近更新了chrome之后,这似乎也不可能实现。在chrome上,我遇到了另一个错误。

我认为localhost不安全,请尝试ws:Instedi希望使用firefox,但与此同时,我发现使用localhost作为ip地址的WebSocket在google chrome上确实有效。我在chrome中遇到的错误与其他问题有关。我也有同样的问题,我也发布了它。我读了一些关于这个问题的文章,他们说这是一个自行创建的证书问题,对此我不确定。等待回应。您可以跟随帖子,以防它可能有助于无法在Firefox上建立WEbsocket安全连接