Sha256: 7a0d530365e862927c94c34600fe919b457a54a873d4dc5a1f41a3de37fbb72a

Contents?: true

Size: 437 Bytes

Versions: 5

Compression:

Stored size: 437 Bytes

Contents

# Usage: $ PUSHER_KEY=YOURKEY ruby examples/hello_pusher.rb

$:.unshift(File.expand_path("../../lib", __FILE__))
require 'pusher-client'
require 'pp'

APP_KEY = ENV['PUSHER_KEY'] # || "YOUR_APPLICATION_KEY"

socket = PusherClient::Socket.new(APP_KEY, { :encrypted => true } )

# Subscribe to a channel
socket.subscribe('hellopusher')

# Bind to a channel event
socket['hellopusher'].bind('hello') do |data|
  pp data
end

socket.connect

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pusher-client-0.6.2 examples/hello_pusher_ssl.rb
pusher-client-0.6.1 examples/hello_pusher_ssl.rb
pusher-client-0.6.0 examples/hello_pusher_ssl.rb
pusher-client-0.5.0 examples/hello_pusher_ssl.rb
pusher-client-0.4.0 examples/hello_pusher_ssl.rb