Closed atomkirk closed 11 years ago
The purpose of the client version
parameter has actually changed slightly since it was first created. It now represents the version number of the client library. The protocol
parameter is now used to identify the version of the Pusher protocol that the library supports.
See: http://pusher.com/docs/pusher_protocol#websocket-connection
Did you find that changing this help the library function better in some way?
I naively just yanked that version number from what I saw the js library in the web inspector of chrome. I cloned your gem, changes it so the URL it used was exactly like what the js library was using. That made it work but I didn't know which change had made it work, so I reset it to match your repo, built it and installed it and it worked, so none of my changes had mattered. To double check, I uninstalled the gem, re-cloned your repo and built it again, it worked. I uninstalled it and installed it from ruby gems and it didn't work. What do you think? Is what's in this repo built and pushed to ruby gems?
The contents of the repo doesn't match that in ruby gems. The reason for this is that I don't believe this library is functioning correctly right now.
When I run the example I get a 'Websocket connected` log but nothing else. When the client connects it should receive a protocol message from Pusher. See: http://pusher.com/docs/pusher_protocol#connection-events
I believe this is related to https://github.com/pusher/pusher-ruby-client/issues/5
If I trigger an event via the Pusher event creator I don't receive the message either.
The current thinking it to move from using the libwebsocket
dependency to https://github.com/imanel/websocket-ruby to see if that resolves the problem.
If I clone the repo, build the gem, and use it, I DO get all those confirm messages and I get events. What's currently in the repo works fine for me. What's on ruby gems does not work, I get only the one connect message like you describe. Are you sure that when you test you are using the gem built from this source and not from ruby gems? Or are you saying your unit tests fail? I could try running those and see what happens.
Also, as part of my experimenting I removed the port numbers from the URL because the js library was not using them. Perhaps try that.
You're right! It was working, I had a local dependency problem.
I've published a new version of the pusher-client gem: https://rubygems.org/gems/pusher-client
This one represents the code that is in the master branch of this repo.
Beautiful, thanks
I would recommend pushing a new gem out. I installed the gem from ruby gems and it did not work, even the simple example in the README. I forked and cloned the repo and when I did a local
gem build ...
gem install ...
it worked great, so I'm thinking you must have some more up-to-date code that needs to be pushed out to ruby gems. Just a theory.