HttpClient

An asynchronous HTTP client.

It allows you to make requests to HTTP servers, and a single client can make requests to any server.

It also allows you to open WebSockets to servers.

The client can also pool HTTP connections.

For pooling to occur, keep-alive must be true on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is true). In this case connections will be pooled and re-used if there are pending HTTP requests waiting to get a connection, otherwise they will be closed.

This gives the benefits of keep alive when the client is loaded but means we don't keep connections hanging around unnecessarily when there would be no benefits anyway.

The client also supports pipe-lining of requests. Pipe-lining means another request is sent on the same connection before the response from the preceding one has returned. Pipe-lining is not appropriate for all requests.

To enable pipe-lining, it must be enabled on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is false).

When pipe-lining is enabled the connection will be automatically closed when all in-flight responses have returned and there are no outstanding pending requests to write.

The client is designed to be reused between requests.

package

Default

Methods

__construct

__construct() 

Close the client. Closing will close down any pooled connections.

close() : void

Clients should always be closed after use.

Set a connection handler for the client. This handler is called when a new connection is established.

connectionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP DELETE request to send to the server with the specified options.

delete( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options delete($options)

Create an HTTP DELETE request to send to the server at the default host and port.

param $requestURI [string] the relative URI delete($requestURI)

Create an HTTP DELETE request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI delete($host, $requestURI)

Create an HTTP DELETE request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler delete($options, $responseHandler)

Create an HTTP DELETE request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler delete($requestURI, $responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI delete($port, $host, $requestURI)

Create an HTTP DELETE request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler delete($host, $requestURI, $responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler delete($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP DELETE request to send to the server using an absolute URI

deleteAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI deleteAbs($absoluteURI)

Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler deleteAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP GET request to send to the server with the specified options.

get( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options get($options)

Create an HTTP GET request to send to the server at the default host and port.

param $requestURI [string] the relative URI get($requestURI)

Create an HTTP GET request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI get($host, $requestURI)

Create an HTTP GET request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler get($options, $responseHandler)

Create an HTTP GET request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler get($requestURI, $responseHandler)

Create an HTTP GET request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI get($port, $host, $requestURI)

Create an HTTP GET request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler get($host, $requestURI, $responseHandler)

Create an HTTP GET request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler get($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP GET request to send to the server using an absolute URI

getAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI getAbs($absoluteURI)

Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler getAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP GET request to the server with the specified options, specifying a response handler to receive the response

getNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [array] the request options param $responseHandler [callable] the response handler getNow($options, $responseHandler)

Sends an HTTP GET request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler getNow($requestURI, $responseHandler)

Sends an HTTP GET request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler getNow($host, $requestURI, $responseHandler)

Sends an HTTP GET request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler getNow($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP HEAD request to send to the server with the specified options.

head( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options head($options)

Create an HTTP HEAD request to send to the server at the default host and port.

param $requestURI [string] the relative URI head($requestURI)

Create an HTTP HEAD request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI head($host, $requestURI)

Create an HTTP HEAD request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler head($options, $responseHandler)

Create an HTTP HEAD request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler head($requestURI, $responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI head($port, $host, $requestURI)

Create an HTTP HEAD request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler head($host, $requestURI, $responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler head($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP HEAD request to send to the server using an absolute URI

headAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI headAbs($absoluteURI)

Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler headAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive the response

headNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [array] the request options param $responseHandler [callable] the response handler headNow($options, $responseHandler)

Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler headNow($requestURI, $responseHandler)

Sends an HTTP HEAD request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler headNow($host, $requestURI, $responseHandler)

Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler headNow($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Whether the metrics are enabled for this measured object

isMetricsEnabled() : boolean

Response

boolean

{@code true} if metrics are enabled

Create an HTTP OPTIONS request to send to the server with the specified options.

options( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options options($options)

Create an HTTP OPTIONS request to send to the server at the default host and port.

param $requestURI [string] the relative URI options($requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI options($host, $requestURI)

Create an HTTP OPTIONS request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler options($options, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler options($requestURI, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI options($port, $host, $requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler options($host, $requestURI, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler options($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP OPTIONS request to send to the server using an absolute URI

optionsAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI optionsAbs($absoluteURI)

Create an HTTP OPTIONS request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler optionsAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP OPTIONS request to the server with the specified options, specifying a response handler to receive the response

optionsNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [array] the request options param $responseHandler [callable] the response handler optionsNow($options, $responseHandler)

Sends an HTTP OPTIONS request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler optionsNow($requestURI, $responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler optionsNow($host, $requestURI, $responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler optionsNow($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP POST request to send to the server with the specified options.

post( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options post($options)

Create an HTTP POST request to send to the server at the default host and port.

param $requestURI [string] the relative URI post($requestURI)

Create an HTTP POST request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI post($host, $requestURI)

Create an HTTP POST request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler post($options, $responseHandler)

Create an HTTP POST request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler post($requestURI, $responseHandler)

Create an HTTP POST request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI post($port, $host, $requestURI)

Create an HTTP POST request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler post($host, $requestURI, $responseHandler)

Create an HTTP POST request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler post($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP POST request to send to the server using an absolute URI

postAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI postAbs($absoluteURI)

Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler postAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP PUT request to send to the server with the specified options.

put( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [array] the request options put($options)

Create an HTTP PUT request to send to the server at the default host and port.

param $requestURI [string] the relative URI put($requestURI)

Create an HTTP PUT request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI put($host, $requestURI)

Create an HTTP PUT request to send to the server with the specified options, specifying a response handler to receive the response

param $options [array] the request options param $responseHandler [callable] the response handler put($options, $responseHandler)

Create an HTTP PUT request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler put($requestURI, $responseHandler)

Create an HTTP PUT request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI put($port, $host, $requestURI)

Create an HTTP PUT request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler put($host, $requestURI, $responseHandler)

Create an HTTP PUT request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler put($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP PUT request to send to the server using an absolute URI

putAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI putAbs($absoluteURI)

Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler putAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Set a redirect handler for the http client.

redirectHandler( $arg0) : $this

The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with @see \io\vertx\jphp\core\http\HttpClientRequest::setFollowRedirects.

The redirect handler is passed the @see \io\vertx\jphp\core\http\HttpClientResponse, it can return an @see \io\vertx\jphp\core\http\HttpClientRequest or null.

  • when null is returned, the original response is processed by the original request response handler
  • when a new Future is returned, the client will send this new request
The new request will get a copy of the previous request headers unless headers are set. In this case, the client assumes that the redirect handler exclusively managers the headers of the new request.

The handler must return a Future unsent so the client can further configure it and send it.

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP request to send to the server with the specified options.

request( $arg0,  $arg1,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $method [string] the HTTP method param $options [array] the request options request($method, $options)

Create an HTTP request to send to the server at the default host and port.

param $method [string] the HTTP method param $requestURI [string] the relative URI request($method, $requestURI)

Like @see \io\vertx\jphp\core\http\HttpClient::request using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the options parameter.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $options [array] request($method, $serverAddress, $options) Create an HTTP request to send to the server at the specified host and default port. param $method [string] the HTTP method param $host [string] the host param $requestURI [string] the relative URI request($method, $host, $requestURI) Create an HTTP request to send to the server with the specified options, specifying a response handler to receive param $method [string] the HTTP method param $options [array] the request options param $responseHandler [callable] request($method, $options, $responseHandler) Create an HTTP request to send to the server at the default host and port, specifying a response handler to receive the response param $method [string] the HTTP method param $requestURI [string] the relative URI param $responseHandler [callable] the response handler request($method, $requestURI, $responseHandler) Create an HTTP request to send to the server at the specified host and port. param $method [string] the HTTP method param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI request($method, $port, $host, $requestURI) Like @see \io\vertx\jphp\core\http\HttpClient::request using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the options parameter.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $options [array] param $responseHandler [callable] request($method, $serverAddress, $options, $responseHandler) Create an HTTP request to send to the server at the specified host and default port, specifying a response handler to receive the response param $method [string] the HTTP method param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler request($method, $host, $requestURI, $responseHandler) Like @see \io\vertx\jphp\core\http\HttpClient::request using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the host and port parameters.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $port [integer] param $host [string] param $requestURI [string] request($method, $serverAddress, $port, $host, $requestURI) Create an HTTP request to send to the server at the specified host and port, specifying a response handler to receive the response param $method [string] the HTTP method param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler request($method, $port, $host, $requestURI, $responseHandler) Like @see \io\vertx\jphp\core\http\HttpClient::request using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the host and port parameters.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $port [integer] param $host [string] param $requestURI [string] param $responseHandler [callable] request($method, $serverAddress, $port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string

$arg1

string | array | integer | SocketAddress

$arg2

callable | string | array | integer

$arg3

callable | string

$arg4

callable | string

$arg5

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP request to send to the server using an absolute URI

requestAbs( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $method [string] the HTTP method param $absoluteURI [string] the absolute URI requestAbs($method, $absoluteURI)

Like @see \io\vertx\jphp\core\http\HttpClient::requestAbs using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the absoluteURI parameter.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $absoluteURI [string] requestAbs($method, $serverAddress, $absoluteURI) Create an HTTP request to send to the server using an absolute URI, specifying a response handler to receive the response param $method [string] the HTTP method param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler requestAbs($method, $absoluteURI, $responseHandler) Like @see \io\vertx\jphp\core\http\HttpClient::requestAbs using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.

The request host header will still be created from the absoluteURI parameter.

Use to connect to a unix domain socket server. param $method [string] param $serverAddress [SocketAddress] param $absoluteURI [string] param $responseHandler [callable] requestAbs($method, $serverAddress, $absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

string | SocketAddress

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Connect a WebSocket at the relative request URI using the default host and port

webSocket( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : void

param $requestURI [string] the relative URI param $handler [callable] handler that will be called with the websocket when connected webSocket($requestURI, $handler)

Connect a WebSocket with the specified options.

param $options [array] the request options param $handler [callable] webSocket($options, $handler)

Connect a WebSocket to the host and relative request URI and default port

param $host [string] the host param $requestURI [string] the relative URI param $handler [callable] handler that will be called with the websocket when connected webSocket($host, $requestURI, $handler)

Connect a WebSocket to the specified port, host and relative request URI

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $handler [callable] handler that will be called with the websocket when connected webSocket($port, $host, $requestURI, $handler)

Arguments

$arg0

string | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Connect a WebSocket with the specified absolute url, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols.

webSocketAbs( $arg0,  $arg1,  $arg2,  $arg3,  $arg4) : void

Arguments

$arg0

string

$arg1

MultiMap

$arg2

string

$arg3

array

$arg4

callable