Class: WebSocketRequest

olympe.net. WebSocketRequest

Web Socket Request.


new WebSocketRequest( [host] [, port] [, path] [, ssl])

Creates an instance of WebSocketRequest.

Parameters:
Name Type Argument Default Description
host string <optional>
localhost

Request hostname.

port number <optional>
80

Request port.

path string <optional>
"/"

Request path.

ssl boolean <optional>
false

Whether the request is SSL enabled, if port is 443 the default is true.

Methods


getHost()

Gets the request host.

Returns:

The host name.

Type
string

getPath()

Gets the request's path.

Returns:

The path.

Type
string

getPort()

Gets the request port.

Returns:

The port.

Type
number

getUrl()

Gets the request's URL.

Returns:

The URL.

Type
string

isSSL()

Checks whether the request is over SSL.

Returns:

true if the request is over SSL.

Type
boolean

setHost(hostname)

Sets the request host.

Parameters:
Name Type Argument Description
hostname string <nullable>

The host name.


setPath(path)

Sets the request path.

Parameters:
Name Type Description
path string

The path.


setPort(port)

Sets the request's port.

Parameters:
Name Type Description
port number

Port number.


setSSL(ssl)

Set this request as SSL enabled.

Parameters:
Name Type Description
ssl boolean

true for SSL.


toString()

Gets a string representation.

Returns:

The string representation.

Type
string