SockJSHandler

A handler that allows you to handle SockJS connections from clients.

We currently support version 0.3.3 of the SockJS protocol, which can be found in this tag:

package

Default

Methods

__construct

__construct() 

Bridge the SockJS handler to the Vert.x event bus. This basically installs a built-in SockJS socket handler which takes SockJS traffic and bridges it to the event bus, thus allowing you to extend the server-side Vert.x event bus to browsers

bridge( $arg0,  $arg1 = null) : $this

param $bridgeOptions [BridgeOptions | array] options to configure the bridge with bridge($bridgeOptions)

Like @see \io\vertx\jphp\ext\web\handler\sockjs\SockJSHandler::bridge but specifying a handler that will receive bridge events.

param $bridgeOptions [BridgeOptions | array] options to configure the bridge with param $bridgeEventHandler [callable] handler to receive bridge events bridge($bridgeOptions, $bridgeEventHandler)

Arguments

$arg0

array | BridgeOptions

$arg1

callable

Response

$this

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

Create a SockJS handler

create( $arg0,  $arg1 = null) : \io\vertx\jphp\ext\web\handler\sockjs\SockJSHandler
static

param $vertx [Vertx] the Vert.x instance create($vertx)

Create a SockJS handler

param $vertx [Vertx] the Vert.x instance param $options [SockJSHandlerOptions | array] options to configure the handler create($vertx, $options)

Arguments

$arg0

Vertx

$arg1

SockJSHandlerOptions | array

Response

\io\vertx\jphp\ext\web\handler\sockjs\SockJSHandler

the handler

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

RoutingContext

Set a SockJS socket handler. This handler will be called with a SockJS socket whenever a SockJS connection is made from a client

socketHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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