Connect to Juggernaut with Ruby

169 Views Asked by At
require "juggernaut"
Juggernaut.publish("channel1", "Some data")

The code above works if Juggernaut is on the same server as the one running the code. What's the syntax to use a Juggernaut running on another server?

1

There are 1 best solutions below

0
On BEST ANSWER

The syntax is the same. I have a juggernaut.yml config file in my config directory with settings for each environment. To run juggernaut on port 8080 of localhost in development, I have:

development:
  host: 'localhost'
  port: 8080

To run it on a different host, you can just change that host setting (e.g. 'jugg.someserver.com')