WebSocket connection to 'ws://zh.whzd.wang/arcGpt/websocket/1714770640800407
时间: 2023-08-09 13:09:51 浏览: 174
websocket链接
回答: 根据提供的引用内容,WebSocket连接到'ws://zh.whzd.wang/arcGpt/websocket/1714770640800407'的问题可以通过修改配置文件来解决。你可以在Vue项目的config.vue文件中添加以下配置信息:
```
devServer: {
host: '0.0.0.0',
port: 6103,
client: {
webSocketURL: 'ws://0.0.0.0:6103/ws',
},
headers: {
'Access-Control-Allow-Origin': '*',
},
},
```
这样配置后,WebSocket连接应该能够成功建立。\[3\]
#### 引用[.reference_title]
- *1* [vue项目使用websocket时报错: connection to ‘ws://...‘failed: Error in connection establish](https://blog.csdn.net/weixin_65793170/article/details/128127889)[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^insert_down1,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^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [WebSocket connection to ‘ws://xxx.xxx.x.xxxx:8080/ws‘failed:问题](https://blog.csdn.net/z914020826/article/details/127232233)[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^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文