Method: WebSocket::Handshake::Base#uri

Defined in:
lib/websocket/handshake/base.rb

#uriString

URI of request.

Examples:

@handshake.uri #=> "ws://example.com/path?query=true"

Returns:

  • Full URI with protocol



87
88
89
90
91
92
93
94
# File 'lib/websocket/handshake/base.rb', line 87

def uri
  uri =  String.new(secure ? 'wss://' : 'ws://')
  uri << host
  uri << ":#{port}" unless default_port?
  uri << path
  uri << "?#{query}" if query
  uri
end