Sha256: 538509e7563f236cf494bc778766a1553e83af4d29b3cda6e0654237419e8e5b

Contents?: true

Size: 454 Bytes

Versions: 2

Compression:

Stored size: 454 Bytes

Contents

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

require 'rubygems'
require './lib/pusher-client.rb'
require 'pp'

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

PusherClient.logger = Logger.new(STDOUT)
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

2 entries across 2 versions & 1 rubygems

Version Path
pusher-client-0.3.1 examples/hello_pusher_ssl.rb
pusher-client-0.3.0 examples/hello_pusher_ssl.rb