httprb / http

HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
MIT License
3.01k stars 321 forks source link

Using WebSocket URIs without ports raises a NoMethodError #682

Open nomis opened 3 years ago

nomis commented 3 years ago

There is no default_port for the ws and wss schemes.

If the port is omitted, it works with HTTP::URI.parse but not when making requests:

irb(main):001:0> HTTP.get("ws://example")
Traceback (most recent call last):
        1: from (irb):1
NoMethodError (undefined method `default_port' for #<HTTP::URI:0x0056444e3e7798 URI:ws://example/>)