ohler55 / agoo

A High Performance HTTP Server for Ruby
MIT License
912 stars 39 forks source link

localhost is crashing as bind address #123

Closed noraj closed 11 months ago

noraj commented 1 year ago

localhost is crashing as bind address

Agoo::Server.init(6464, 'root', bind: 'http://localhost:4242')
(irb):8:in `init': http bind address is not valid. (localhost:4242) (ArgumentError)
        from (irb):8:in `<main>'
        from /home/noraj/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/irb:25:in `load'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/irb:25:in `<main>'

Agoo::Server.init(6464, 'root', bind: 'localhost:4242')
(irb):9:in `init': \xE0\x94\xC4#\xFF bind address is not valid. (localhost:4242) (ArgumentError)
        from (irb):9:in `<main>'
        from /home/noraj/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/irb:25:in `load'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/irb:25:in `<main>'

but 127.0.0.1 works.

Agoo::Server.init(6464, 'root', bind: 'http://127.0.0.1:4242')
# => nil
Agoo::Server.init(6464, 'root', bind: '127.0.0.1:4242')
# => nil
ohler55 commented 1 year ago

I'll include this in the #123 issue fix.

ohler55 commented 1 year ago

Should work in the "in-a-bind" branch. Can you try?

noraj commented 1 year ago

Looks like it is 🎉

ohler55 commented 1 year ago

Release v2.15.8 includes the fix.