diff options
author | Kentaro Goto <gotoken@notwork.org> | 2021-04-26 09:58:31 +0900 |
---|---|---|
committer | Kentaro Goto <gotoken+github@gmail.com> | 2021-08-23 09:59:09 +0900 |
commit | 8361675e3a117b2cccee6bcc92440667fe35be7b (patch) | |
tree | dce8ed8bd1a92045862ef6452222092a58ad591f /lib/un.rb | |
parent | d7da5ca5e1a6b0b17c31ba821b6217bbabcc1fca (diff) |
Display httpd URLs
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4415
Diffstat (limited to 'lib/un.rb')
-rw-r--r-- | lib/un.rb | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -346,6 +346,14 @@ def httpd end options[:Port] ||= 8080 # HTTP Alternate options[:DocumentRoot] = argv.shift || '.' + s = nil + options[:StartCallback] = Proc.new do + logger = s.logger + logger.info("To access this server, open this file in a browser:") + s.listeners.each do |listener| + logger.info(" http://#{listener.connect_address.inspect_sockaddr}") + end + end s = WEBrick::HTTPServer.new(options) shut = proc {s.shutdown} siglist = %w"TERM QUIT" |