Module: Ronin::Support::Web::WebSocket::URLMethods Private
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Mixin which accepts and parses a ws://
or wss://
URL.
Instance Attribute Summary collapse
-
#host ⇒ String
readonly
The websocket host name.
-
#path ⇒ String
readonly
The websocket port.
-
#port ⇒ Integer
readonly
The websocket port.
-
#url ⇒ URI::WS, URI::WSS
readonly
The parsed
ws://
orwss://
URI.
Instance Method Summary collapse
-
#initialize(url) ⇒ Object
Sets the #url.
-
#ssl? ⇒ Boolean
Determines whether the websocket uses SSL/TLS.
Instance Attribute Details
#host ⇒ String (readonly)
The websocket host name.
45 46 47 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 45 def host @host end |
#path ⇒ String (readonly)
The websocket port.
59 60 61 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 59 def path @path end |
#port ⇒ Integer (readonly)
The websocket port.
52 53 54 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 52 def port @port end |
#url ⇒ URI::WS, URI::WSS (readonly)
The parsed ws://
or wss://
URI.
38 39 40 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 38 def url @url end |
Instance Method Details
#initialize(url) ⇒ Object
Sets the #url.
69 70 71 72 73 74 75 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 69 def initialize(url) @url = URI(url) @host = @url.host @port = @url.port @path = @url.path @ssl = (@url.scheme == 'wss') end |
#ssl? ⇒ Boolean
Determines whether the websocket uses SSL/TLS.
84 85 86 |
# File 'lib/ronin/support/web/websocket/url_methods.rb', line 84 def ssl? @ssl end |