WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

The HTTP tunnel uses a websocket for bi-directional communication between NKP client and server. The client side of the tunnel instantiates a websocket client using the HTTP libraries provided by the urn:org:netkernel:tpt:http module. The server side of the tunnel requires connection to an existing HTTP server. This is described in more detail below.

Client-side tunnel

    <tunnel factory="com.ten60.netkernel.nkp.http.HTTPNKPTunnelFactory">

Supported configuration options are:

  • url - mandatory URL of serverside endpoint to handle messages. This may be ws or wss scheme.
  • maxIdleTimeOut - optional configuration of timeout in milliseconds to close websocket if no messages are sent

Server-side tunnel

The server-side tunnel doesn't instantiate it's own HTTP server, rather it allows you connect it to a pre-existing HTTP server. This allows flexibility to combine several discrete NKP tunnels and any additional functionality onto a single port. To route websockets from an existing HTTP server you need to bind the tunnel to an ROC endpoint which will accept connections on the appropriate path and then import this endpoint into the fulcrum of an existing HTTP transport fulcrum. A prototype NKPWebsocketEndpoint is provided which handles the websocket and passes it to a corresponding tunnel configured with the same transportId. See the following example:

  <literal uri="res:/etc/system/SimpleDynamicImportHook.xml" type="xml">
        <argument name="socketid" min="0" max="1" />
        <argument name="status" min="0" max="1" />
        <argument name="reason" min="0" max="1" />
      <tunnel factory="com.ten60.netkernel.nkp.http.HTTPNKPTunnelFactory">

Supported configuration options are:

  • transportId - mandatory id which connects an instance of NKPWebsocketEndpoint to this tunnel.