Ido.S
Ido.S

Reputation: 246

nodejs websocket initial connection timeout

I have a node client that tries to connect to a Websocket server that is behind an ELB.

Sometimes, the initial connection hangs and does not return, and i was wondering if there's a timeout options in websockets/ws module.

I saw that it's using the native https/http node lib and that lib has a setTimeout method - but it's not being used.

I patched my installed module to use that method and it worked. Is there another option I'm not aware of? Should I submit a PR?

Thanks!

Upvotes: 5

Views: 8582

Answers (1)

Ido.S
Ido.S

Reputation: 246

in case anyone has the same issue, i added this feature in 3.0.1 https://github.com/websockets/ws/commit/b32016995e9620ed6d5826464b2c3ee931e2240a

Upvotes: 8

Related Questions