Java API for WebSocket 1.0
This feature enables support for WebSocket applications written to the Java API for WebSocket 1.0 specification.
Enable this feature
To enable the Java API for WebSocket 1.0 feature, add the following element declaration inside the featureManager element in the server.xml file:
<feature>websocket-1.0</feature>
Developing a feature that depends on this feature
If we are developing a feature that depends on the Java API for WebSocket 1.0 feature, include the following item in the Subsystem-Content header in the feature manifest file for the new feature:
com.ibm.websphere.appserver.websocket-1.0; type="osgi.subsystem.feature"
Features that this feature enables
API packages provided by this feature
- javax.websocket
- javax.websocket.server
Feature configuration elements
We can use the following elements in the server.xml file to configure the Java API for WebSocket 1.0 feature:
- wsocOutbound
- Configuration properties for WAS WebSocket outgoing connection requests.
Attribute name Data type Default value Description httpOptionsRef A reference to top level httpOptions element (string). defaultHttpOptions HTTPprotocol options for WAS WebSocket outbound sslOptionsRef A reference to top level sslOptions element (string). SSL protocol options for WAS WebSocket outbound tcpOptionsRef A reference to top level tcpOptions element (string). defaultTCPOptions TCP protocol options for WAS WebSocket outbound
- wsocOutbound > httpOptions
Description: HTTPprotocol options for WAS WebSocket outbound
Required: false
Data type:
Attribute name Data type Default value Description keepAliveEnabled boolean true Enables persistent connections (HTTP keepalive). If true, connections are kept alive for reuse by multiple sequential requests and responses. If false, connections are closed after the response is sent. maxKeepAliveRequests int Minimum: -1
100 Maximum number of persistent requests allowed on a single HTTP connection if persistent connections are enabled. A value of -1 means unlimited. persistTimeout A period of time with second precision 30s Amount of time that a socket will be allowed to remain idle between requests. This setting only applies if persistent connections are enabled. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), or seconds (s). For example, specify 30 seconds as 30s. We can include multiple values in a single entry. For example, 1m30s is equivalent to 90 seconds. readTimeout A period of time with second precision 60s Amount of time to wait for a read request to complete on a socket after the first read occurs. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), or seconds (s). For example, specify 30 seconds as 30s. We can include multiple values in a single entry. For example, 1m30s is equivalent to 90 seconds. removeServerHeader boolean false Removes server implementation information from HTTP headers and also disables the default Liberty profile welcome page. writeTimeout A period of time with second precision 60s Amount of time to wait on a socket for each portion of the response data to be transmitted. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), or seconds (s). For example, specify 30 seconds as 30s. We can include multiple values in a single entry. For example, 1m30s is equivalent to 90 seconds.
- wsocOutbound > sslOptions
Description: SSL protocol options for WAS WebSocket outbound
Required: false
Data type:
Attribute name Data type Default value Description sessionTimeout A period of time with second precision 1d Amount of time to wait for a read or write request to complete on a socket. This value is overridden by protocol-specific timeouts. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), or seconds (s). For example, specify 30 seconds as 30s. We can include multiple values in a single entry. For example, 1m30s is equivalent to 90 seconds. sslRef string The default SSL configuration repertoire. The default value is defaultSSLSettings. suppressHandshakeErrors boolean false Disable logging of SSL handshake errors. SSL handshake errors can occur during normal operation, however these messages can be useful when SSL is behaving unexpectedly.
- wsocOutbound > tcpOptions
Description: TCP protocol options for WAS WebSocket outbound
Required: false
Data type:
Attribute name Data type Default value Description inactivityTimeout A period of time with millisecond precision 60s Amount of time to wait for a read or write request to complete on a socket. This value is overridden by protocol-specific timeouts. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), seconds (s), or milliseconds (ms). For example, specify 500 milliseconds as 500ms. We can include multiple values in a single entry. For example, 1s500ms is equivalent to 1.5 seconds. soReuseAddr boolean true Enables immediate rebind to a port with no active listener.