Skip to content

Commit

Permalink
Remove port option
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudgg committed Apr 14, 2013
1 parent e06e711 commit a133320
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ Available options:

``` ruby
:host => '127.3.3.1' # default '0.0.0.0'
:port => '12345' # default '35729'
:apply_css_live => false # default true
:override_url => false # default false
:grace_period => 0.5 # default 0 (seconds)
Expand Down
1 change: 0 additions & 1 deletion lib/guard/livereload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def initialize(watchers = [], options = {})
super
@options = {
:host => '0.0.0.0',
:port => '35729',
:apply_css_live => true,
:override_url => false,
:grace_period => 0
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/livereload/reactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def start_threaded_reactor(options)
Thread.new do
EventMachine.run do
UI.info "LiveReload is waiting for a browser to connect."
EventMachine.start_server(options[:host], options[:port], WebSocket, {}) do |ws|
EventMachine.start_server(options[:host], 35729, WebSocket, {}) do |ws|
ws.onopen do
begin
UI.info "Browser connected."
Expand Down
16 changes: 1 addition & 15 deletions spec/guard/livereload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@
end
end

describe ":port option" do
it "is '35729' by default" do
subject = Guard::LiveReload.new([])
subject.options[:port].should == '35729'
end

it "can be set to '12345'" do
subject = Guard::LiveReload.new([], { :port => '12345' })
subject.options[:port].should == '12345'
end
end

describe ":apply_css_live option" do
it "is true by default" do
subject = Guard::LiveReload.new([])
Expand Down Expand Up @@ -70,7 +58,6 @@
subject = Guard::LiveReload.new([])
Guard::LiveReload::Reactor.should_receive(:new).with(
:host => '0.0.0.0',
:port => '35729',
:apply_css_live => true,
:override_url => false,
:grace_period => 0
Expand All @@ -79,11 +66,10 @@
end

it "creates reactor with given options" do
subject = Guard::LiveReload.new([], { :api_version => '1.3', :host => '127.3.3.1', :port => '12345', :apply_css_live => false, :override_url => true, :grace_period => 1 })
subject = Guard::LiveReload.new([], { :api_version => '1.3', :host => '127.3.3.1', :apply_css_live => false, :override_url => true, :grace_period => 1 })
Guard::LiveReload::Reactor.should_receive(:new).with(
:api_version => '1.3',
:host => '127.3.3.1',
:port => '12345',
:apply_css_live => false,
:override_url => true,
:grace_period => 1
Expand Down

4 comments on commit a133320

@trabianmatt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using the 'port' option to allow development of multiple projects at once. While I can do the same with different hosts aliased to my development machine, it's less convenient. Is there a reason for removing the port or a different way of accomplishing this goal now?

Thanks!

@thibaudgg
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port options has been removed because LiveReload protocol 7:

LiveReload server MUST speak web sockets and HTTP on the same port. The port number SHOULD be 35729. Web socket connections MUST use /livereload as the path to connect to (e.g. ws://localhost:35729/livereload).

I'm right here @andreyvit ?

@tjmcewan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says "should" not "must" for that section. Seems to me it's still optional.

I was wanting to change the port due to conflicts with LiveReload-sublimetext2. Then again, the Chrome extension doesn't appear to have a configurable port either...

@thibaudgg
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjmcewan You right, sorry about it. I reverted it, port option is back in release 1.3.0

Please sign in to comment.