lib/invoker/power/balancer.rb in invoker-1.2.0 vs lib/invoker/power/balancer.rb in invoker-1.3.0
- old
+ new
@@ -21,10 +21,11 @@
end
class Balancer
attr_accessor :connection, :http_parser, :session, :protocol
DEV_MATCH_REGEX = /([\w-]+)\.dev(\:\d+)?$/
+ XIP_IO_MATCH_REGEX = /([\w-]+)\.\d+\.\d+\.\d+\.\d+\.xip\.io(\:\d+)?$/
def self.run(options = {})
start_http_proxy(InvokerHttpProxy, 'http', options)
start_http_proxy(InvokerHttpsProxy, 'https', options)
end
@@ -99,10 +100,10 @@
@backend_data = false
connection.close_connection_after_writing if backend == session
end
def extract_host_from_domain(host)
- host.match(DEV_MATCH_REGEX)
+ host.match(DEV_MATCH_REGEX) || host.match(XIP_IO_MATCH_REGEX)
end
private
def select_backend_config(host)