Sha256: 43eb37877fd7026e5237b183e6c57695f00e67dae93cfa2458001857a063fd6e

Contents?: true

Size: 756 Bytes

Versions: 2

Compression:

Stored size: 756 Bytes

Contents

# Sinatra::Hijacker

A sinatra plugin to handle websockets by Rack hijacking API.

## Installation

Add this line to your application's Gemfile:

    gem 'sinatra-hijacker'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sinatra-hijacker

## Usage

Register Sinatra::Hijacker and define route by "websocket" method.

```ruby
require 'sinatra/hijacker'

class YourApp < Sinatra::Base

  register Sinatra::Hijacker

  websocket '/ws' do
    ws.onopen{ws.send_data "hello"}
  end
end
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sinatra-hijacker-0.0.2 README.md
sinatra-hijacker-0.0.1 README.md