简体   繁体   English

AWS API 网关 WebSocket 连接错误 - 超时

[英]AWS API Gateway WebSocket Connection Error - Timeout

Like many others here I am trying to setup websockets through API Gateway + Angular and testing in Chrome.像这里的许多其他人一样,我正在尝试通过 API 网关 + Angular 设置 websockets 并在 Chrome 中进行测试。 WSCAT works out most of the time but still times out some of the time. WSCAT 大部分时间都能正常工作,但有时仍会超时。 Chrome/Angular app times out every single time with "net::ERR_CONNECTION_TIMED_OUT" Chrome/Angular 应用程序每次都会因“net::ERR_CONNECTION_TIMED_OUT”而超时

   WebSocketSubject.js:91 WebSocket connection to 'wss://xxx.execute-api.region.amazona.com/v1?auth=foobar' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

I'm, using rxjs like so:我是这样使用 rxjs 的:

import {webSocket, WebSocketSubject} from 'rxjs/webSocket';

but i never ever get a connection in Chrome.但我从来没有在 Chrome 中获得连接。 like i said WSCAT works.就像我说的 WSCAT 有效。 I have used it, please do not tell me to use WSCAT:)我用过,请不要告诉我用WSCAT :)

UPDATE : Just confirmed, vanilla websockets also don't work, so nothing with the library, and also it fails to connect in Safari.更新:刚刚确认,香草 websockets 也不起作用,所以图书馆没有,而且它也无法在 Safari 中连接。 But like i said, wscat works just fine.但就像我说的,wscat 工作得很好。

Any ideas?有任何想法吗?

Not sure what happened, but destroying the API and rebuilding it made it "magically" start working... hopefully it won't happen again.不知道发生了什么,但破坏 API 并重建它使其“神奇地”开始工作......希望它不会再次发生。

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

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