WebSocket connection to 'ws://192.168.10.206:8013/ServerHub' failed:
时间: 2023-10-16 13:01:27 浏览: 189
问题:WebSocket连接到'ws://192.168.10.206:8013/ServerHub'失败了。
回答:根据提供的引用内容,可以看出这个问题是由于WebSocket连接失败导致的。根据引用\[1\]和引用\[2\]的内容,可以尝试修改vue.config.js文件中的devServer配置来解决这个问题。具体的修改方法是将client的webSocketURL属性的值改为'ws://0.0.0.0:3000/ws',并且添加headers属性并设置'Access-Control-Allow-Origin'为'*'。这样修改后,应该可以解决WebSocket连接失败的问题。
#### 引用[.reference_title]
- *1* [解决WebSocketClient.js?5586:16 WebSocket connection to ‘ws://192.168.1.102:8999/ws‘ failed:](https://blog.csdn.net/m0_62323730/article/details/128846402)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [vue 报错:WebSocket connection to ‘ws://192.168.51.116:3000/ws‘ failed:](https://blog.csdn.net/sherlyxoxo/article/details/125647887)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文