Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

bind puma to external IP (for remote machine) and change ws endpoint #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ You must have redis installed and running on the default port:6379 (or configure

## Starting the servers

0. Check `config/puma.rb`
1. Run `./bin/setup`
2. Run `./bin/cable`
3. Open up a separate terminal and run: `./bin/rails server`
3. Open up a separate terminal and run: `./bin/rails server` (if you want to use config/puma.rb, please run `bundle exec puma`)
4. One more terminal to run redis server: `redis-server`
4. Visit `http://localhost:3000`

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/channels/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#= require_tree .

@App = {}
App.cable = Cable.createConsumer 'ws://localhost:28080'
App.cable = Cable.createConsumer 'ws://' + window.location.hostname + ':28080'
5 changes: 5 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# https://github.com/puma/puma/blob/master/examples/config.rb
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#config

bind 'tcp://0.0.0.0:9292'