简体   繁体   English

websocket上的以下错误是什么意思以及如何解决

[英]what does the following error on websocket mean and how to fix it

I am trying to connect my ALEXA skill kit through lambda function to ROS (running on my ubutnu VM machine) via web sockets. 我试图通过Web套接字通过lambda函数将ALEXA技能套件连接到ROS(在ubutnu VM机器上运行)。 The problem is web sockets connection is not being established. 问题是未建立Web套接字连接。 I get the following error message: 我收到以下错误消息:

Error connecting to websocket server: { Error: connect ETIMEDOUT 192.168.0.20:9090
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '192.168.0.20',
port: 9090,
type: 'error',
target: 
WebSocket {
domain: null,
_events: 
{ open: [Object],
close: [Object],
error: [Object],
message: [Object] },
_eventsCount: 4,
_maxListeners: undefined,
_socket: null,
_ultron: null,
_closeReceived: false,
bytesReceived: 0,
readyState: 0,
supports: { binary: true },
extensions: {},
_isServer: false,
url: 'ws://192.168.0.20:9090',
protocolVersion: 13 } }
  • WebSocket URL '192.168.0.20' is a local address. WebSocket URL“ 192.168.0.20”是本地地址。 if you are using AWS Lambda, then your lambda function can not connect to '192.168.0.20'. 如果您使用的是AWS Lambda,则您的lambda函数无法连接到“ 192.168.0.20”。 Because they are not on the same network 因为它们不在同一网络上

  • If your Alexa kit and WebSocket on the same network, Because of VM they will not on the exact same network. 如果您的Alexa套件和WebSocket位于同一网络上,由于VM,它们将不在完全相同的网络上。 VM creates its own network 虚拟机创建自己的网络

@hasbi has the right answer to why you are getting this error. @hasbi对于为什么会出现此错误有正确的答案。

As a work around, consider using a tunneling service such as ngrok (free). 解决方法是,考虑使用隧道服务,例如ngrok(免费)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM