Configuring Proxy with Apache Knox
Also available as:
PDF
loading table of contents...

Enable WebSockets

How to enable WebSockets, when configuring the Knox Gateway. Enabling WebSockets for Knox allows you to proxy applications that use WebSocket connections (e.g., Zeppelin.)

WebSocket is a communication protocol that allows full duplex communication over single TCP connection. Knox provides out-of-the-box support for WebSocket protocol, but currently, only text-based messages are supported.

By default, WebSocket functionality is disabled. WebSocket functionality must be enabled for Zeppelin UI (<role>ZEPPELINUI</role>) service definition to work.

  1. In /conf/gateway-site.xml, change gateway.websocket.feature.enabled to true:
    <property>
          <name>gateway.websocket.feature.enabled</name>
          <value>true</value>
          <description>Enable/Disable websocket feature.</description>
      </property>
  2. In /conf/{topology}.xml, change the topology rule:
    <service>
          <role>WEBSOCKET</role>
          <url>ws://myhost:9999/ws</url>
      </service>
  3. Restart the gateway:
    cd $gateway bin/gateway.sh stop bin/gateway.sh start