From e3946a06d911fa24159e136b5b526c97d4e71d21 Mon Sep 17 00:00:00 2001 From: Eliott Appleford Date: Sat, 5 Apr 2014 21:55:01 +0100 Subject: [PATCH] Print correct IP and mobile testing support Address `0.0.0.0` wasn't valid on windows, use localhost instead Finds a local IP that will also allow the development server to run on mobiles --- middleman-core/lib/middleman-core/preview_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/preview_server.rb b/middleman-core/lib/middleman-core/preview_server.rb index e8728976..3191e741 100644 --- a/middleman-core/lib/middleman-core/preview_server.rb +++ b/middleman-core/lib/middleman-core/preview_server.rb @@ -15,7 +15,7 @@ module Middleman # @return [void] def start(opts={}) @options = opts - @host = @options[:host] || Socket.gethostname + @host = @options[:host] || Socket.ip_address_list.find(&:ipv4_private?).ip_address @port = @options[:port] || DEFAULT_PORT mount_instance(new_app)