ngauthier / tubesock

Websocket interface on Rack Hijack w/ Rails support
MIT License
622 stars 46 forks source link

Is there a way to respond to ping messages? #54

Open xanguera opened 6 years ago

xanguera commented 6 years ago

Hi, I am trying to setup a connection between Tubesock and the Android library okhttp-ws. It looks like okhttp-ws sends pings but does not provide ping response mechanism. I see that Tubesock seems to have the same behavior. Although I believe ping should be sent by the server, at this point it is easier for me to hack the server than the Android app. Is there a way to enable/add support for ping messages coming into my tubesock implementation? Note, I implement it ina controller, not Rack.

Thanks!

ngauthier commented 6 years ago

I'm sorry I don't know

On Sep 25, 2017 11:48 AM, "Xavier Anguera" notifications@github.com wrote:

Hi, I am trying to setup a connection between Tubesock and the Android library okhttp-ws. It looks like okhttp-ws sends pings but does not provide ping response mechanism. I see that Tubesock seems to have the same behavior. Although I believe ping should be sent by the server, at this point it is easier for me to hack the server than the Android app. Is there a way to enable/add support for ping messages coming into my tubesock implementation? Note, I implement it ina controller, not Rack.

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ngauthier/tubesock/issues/54, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA1VhVTIGCV8qx6Ftt7jTvOfsLT1OJRks5sl8s5gaJpZM4Pi8gI .

xanguera commented 6 years ago

Hi, I might have not placed the question correctly. My question is whether tubesock supports ping callbacks, to send a pong to the client.

ngauthier commented 6 years ago

No it does not. A new type for ping and pong would need to be added here:

https://github.com/ngauthier/tubesock/blob/master/lib/tubesock.rb#L140-L145

xanguera commented 6 years ago

Great, thanks!

On Tue, Sep 26, 2017 at 3:04 PM, Nick Gauthier notifications@github.com wrote:

No it does not. A new type for ping and pong would need to be added here:

https://github.com/ngauthier/tubesock/blob/master/lib/ tubesock.rb#L140-L145

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ngauthier/tubesock/issues/54#issuecomment-332208861, or mute the thread https://github.com/notifications/unsubscribe-auth/AJE6_Ev3B8q1Tv9SeqKZB9UTocfmUTKgks5smQR0gaJpZM4Pi8gI .