Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeps closing connection #35

Open
pke opened this issue Nov 30, 2018 · 3 comments
Open

Keeps closing connection #35

pke opened this issue Nov 30, 2018 · 3 comments

Comments

@pke
Copy link

pke commented Nov 30, 2018

I have nodejs socket server that I connect to.
The ruby client constantly closes the connection after a minute or so and it does not reconnect automatically.

Am I supposed to send some kind of ping to keep the connection alive?

@prateeksen
Copy link

+1

@prateeksen
Copy link

Found a workaround for this:
You can expect a ping from WebSocket server and on receiving it you can send a pong:

EventSender.ws.on :message do |msg| if msg.type == :ping ws.send("", :type => :pong) end end

@unasuke
Copy link
Contributor

unasuke commented Dec 30, 2021

@pke This repository was moved ruby-jp/websocket-client-simple. If you still need this, make pull request or issue to ruby-jp/websocket-client-simple again, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants