450 Commits

Author SHA1 Message Date
James Coglan 2824edc61b Update release date for 0.8.0 0.8.0 2025-05-25 18:40:28 +01:00
James Coglan befd449e00 Prefer text frames over binary; if the input is in some non-UTF-8 text encoding, then transcode it 2025-05-25 11:35:17 +01:00
James Coglan e3155f726d Bump version to 0.8.0 2025-05-24 15:49:48 +01:00
James Coglan 22e070485c Default to text frames if the input buffer is specifically UTF8-encoded 2025-05-24 15:47:45 +01:00
James Coglan 64ceaa4f69 Remove Ruby versions unsupported by GitHub 2025-05-24 13:30:17 +01:00
James Coglan 799c0229f2 Move the changelog_uri closer to other similar metadata 2025-05-24 13:27:21 +01:00
James Coglan 188c139303 Merge pull request #93 from mark-young-atg/provide_changelog_link_on_rubygems
Provide a 'Changelog' link on rubygems.org/gems/websocker-driver
2025-05-24 13:25:48 +01:00
James Coglan 61572944fb Update the documentation for representation of binary messages 2025-05-24 13:19:06 +01:00
James Coglan 370ac9b944 Emit binary frames as binary strings by default, and make Driver.frame() treat such strings as binary frames 2025-05-24 13:16:00 +01:00
James Coglan f1c9331b11 Merge pull request #95 from mackuba/binary_format
added :binary_data_format option
2025-05-24 13:12:01 +01:00
Kuba Suder 61bfc0725f added :binary_data_format option 2025-05-08 02:19:07 +02:00
Mark Young f662df08f1 Provide a 'Changelog' link on rubygems.org/gems/websocker-driver
By providing a 'changelog_uri' in the metadata of the gemspec a
'Changelog' link will be shown on https://rubygems.org/gems/websocker-driver
which makes it quick and easy for someone to check on the changes
introduced with a new version.

Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata
2025-01-13 14:35:33 +00:00
James Coglan 3e099cb57b Bump version to 0.7.7 0.7.7 2025-01-04 11:24:15 +00:00
James Coglan d97fcf892e Test on Ruby 3.3 and 3.4 2025-01-03 22:35:49 +00:00
James Coglan 4662524fd3 Merge pull request #91 from HoneyryderChuck/patch-1
add base64 gem to gemspec
2025-01-03 22:35:20 +00:00
Tiago 3ae2cceb00 add base64 gem to gemspec
base64 will no longer be a default gem from ruby 3.4 onwards.
2024-07-18 10:24:29 +01:00
James Coglan 58d4ed7427 Run tests on some additional Ruby versions 2023-09-07 19:28:44 +01:00
James Coglan 2e5faf6b2b Bump version to 0.7.6 0.7.6 2023-07-25 18:08:29 +01:00
James Coglan f23ef0666f Test on Ruby 3.2 2023-07-25 18:02:26 +01:00
James Coglan 3a2931751c Fix handling of default ports on Ruby 3.1 2022-09-10 15:37:55 +01:00
James Coglan a5276e7875 Run tests on Ruby 3.1 2022-09-10 15:27:09 +01:00
James Coglan 4739ec948d Merge pull request #85 from danielmorrison/support-frozen-by-default
Flag files that modify string literals
2022-02-06 23:01:21 +00:00
James Coglan 720a0f23ba Remove implied wss support from the TCPSocket example 2021-11-29 21:46:06 +00:00
Daniel Morrison 0e950c5134 Flag files that modify string literals
When running in an environment that freezes string literals by default, `hybi.rb` raises exceptions as it modifies the `'C2'` string.

Adding the magic comment supports this use case without modifying behavior for anyone else. I added it to one spec too, so that running specs this way (`RUBYOPT="--enable=frozen-string-literal" rspec`) keeps them all passing.
2021-09-13 10:15:25 -04:00
James Coglan 911d14b96a Bump version to 0.7.5 0.7.5 2021-06-12 17:14:11 +01:00
James Coglan 586c27f44e Clarify behaviour of Driver.encode to convert strings to UTF-8 and arrays to ASCII-8BIT 2021-06-12 16:53:51 +01:00
James Coglan 9a4f2f2d1d Do not change the encoding of strings passed to text() 2021-06-09 21:39:40 +01:00
James Coglan 41d20e42fe Bump version to 0.7.4 0.7.4 2021-05-24 23:25:48 +01:00
James Coglan b10eb2bf3e Switch from Travis CI to GitHub Actions 2021-05-18 00:40:42 +01:00
James Coglan 91443b525e Enable Bundler caching for Travis 2021-03-12 16:25:05 +00:00
James Coglan 0f6a8ac9b3 Merge pull request #75 from matti/patch-1
README: example of http response
2021-03-12 16:22:05 +00:00
James Coglan 3ae2e3a0f6 Validate UTF-8 encoding of strings where needed, not on every call to Driver.encode 2021-02-26 16:26:08 +00:00
James Coglan 9ec01dc328 Avoid allocating an array of the string bytes in Hybi#emit_frame 2021-02-26 16:14:58 +00:00
James Coglan 472569ad38 Avoid allocating so many arrays during Hybi#frame 2021-02-26 16:14:53 +00:00
James Coglan 219c409844 Use the Ruby Encoding constants instead of their string names 2021-02-26 14:44:50 +00:00
James Coglan c73f5bcf10 Update Ruby versions on Travis 2021-02-26 14:42:18 +00:00
James Coglan c021b23aef Merge pull request #77 from timcraft/patch-1
Test on ruby 3.0
2021-01-06 15:32:11 +00:00
timcraft bd44d80c6e Test on ruby 3.0 2021-01-06 14:55:22 +00:00
James Coglan eb643f5949 Bump version to 0.7.3 0.7.3 2020-07-09 19:27:04 +01:00
James Coglan e87bfef9bc Accept HTTP responses that have an empty reason-phrase, per RFC 2616 2020-07-09 19:06:13 +01:00
Matti Paksula 4228ca5781 README: example of http response
closes https://github.com/faye/websocket-driver-ruby/issues/74
2020-06-14 10:21:23 +03:00
James Coglan f882bc56d5 Bump version to 0.7.2 0.7.2 2020-05-22 16:06:12 +01:00
James Coglan 46aafa4e99 Set {source,target}_version to work with the current version of javac on macOS 2020-05-14 23:31:30 +01:00
James Coglan db09a1af22 Update Ruby versions 2.4 to 2.7 on Travis 2020-05-14 17:20:25 +01:00
pjaspers 202e1800e0 Allow rack.input.read to return a frozen string
We're seeing this occasionally in our error logs, where the `env`
passed into to the driver will return a frozen string when read.

The stack trace always includes ActionCable in to the mix, so
something like this:

      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver/draft76.rb" line 11 in force_encoding
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver/draft76.rb" line 11 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver.rb" line 162 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver.rb" line 162 in rack
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/client_socket.rb" line 47 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/web_socket.rb" line 10 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/web_socket.rb" line 10 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/base.rb" line 59 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/base.rb" line 59 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb" line 30 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb" line 30 in call

I still don't quite know why someone is sometimes returning a frozen
string (it could also have to with any of the current rack middleware
we're using), but I do know that we can handle it here.

So this adds a spec and some behavior to fix that.
2020-05-14 16:22:20 +01:00
James Coglan b00f58701e Emit ping and pong events from the Server driver 2020-02-14 14:41:43 +01:00
James Coglan d05eb72d2d Mention license change in the changelog 2019-06-13 11:40:48 +01:00
James Coglan e568366f82 Formatting change: {...} should have spaces inside the braces 2019-06-11 16:12:52 +01:00
James Coglan 92334974c5 Bump version to 0.7.1 0.7.1 2019-06-10 12:40:06 +01:00
James Coglan a6bb6a69a9 Change markdown formatting of docs. 2019-05-29 15:34:34 +01:00