Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SockJSHandlerOptions

Options for configuring a SockJS handler

Hierarchy

  • SockJSHandlerOptions

Index

Constructors

constructor

Methods

addDisabledTransport

  • Add a transport (by name) to the set of disabled transports.

    Parameters

    • disabledTransports: string

    Returns SockJSHandlerOptions

getDisabledTransports

  • getDisabledTransports(): string[]
  • Add a transport (by name) to the set of disabled transports.

    Returns string[]

getHeartbeatInterval

  • getHeartbeatInterval(): number
  • In order to keep proxies and load balancers from closing long running HTTP requests we need to pretend that the connection is active and send a heartbeat packet once in a while. This setting controls how often this is done.

    Defaults to 25 seconds.

    Returns number

getLibraryURL

  • getLibraryURL(): string
  • Transports which don't support cross-domain communication natively use an iframe trick. A simple page is served from the SockJS server (using its foreign domain) and is placed in an invisible iframe.

    Code run from this iframe doesn't need to worry about cross-domain issues, as it's being run from domain local to the SockJS server. This iframe also does need to load SockJS javascript client library, and this option lets you specify its URL.

    Returns string

getMaxBytesStreaming

  • getMaxBytesStreaming(): number
  • Most streaming transports save responses on the client side and don't free memory used by delivered messages. Such transports need to be garbage-collected once in a while.

    This setting controls the maximum number of bytes that can be sent over a single HTTP streaming request before it will be closed. After that the client needs to open new request. Setting this value to one effectively disables streaming and will make streaming transports to behave like polling transports.

    Defaults to 128K.

    Returns number

getOrigin

  • getOrigin(): string
  • Set the origin to be verified before a websocket upgrade happens.

    Defaults to null.

    Returns string

getSessionTimeout

  • getSessionTimeout(): number
  • Set the delay before the server sends a close event when a client receiving connection has not been seen for a while.

    Defaults to 5 seconds.

    Returns number

isInsertJSESSIONID

  • isInsertJSESSIONID(): boolean
  • Whether to insert a JSESSIONID cookie so load-balancers ensure requests for a specific SockJS session are always routed to the correct server.

    Defaults to true.

    Returns boolean

isLocalWriteHandler

  • isLocalWriteHandler(): boolean
  • Whether the writeHandler should be local only or cluster-wide.

    Defaults to true.

    Returns boolean

isRegisterWriteHandler

  • isRegisterWriteHandler(): boolean
  • Whether a writeHandler should be registered on the {@link EventBus}.

    Defaults to false.

    Returns boolean

setHeartbeatInterval

  • In order to keep proxies and load balancers from closing long running HTTP requests we need to pretend that the connection is active and send a heartbeat packet once in a while. This setting controls how often this is done.

    Defaults to 25 seconds.

    Parameters

    • heartbeatInterval: number

    Returns SockJSHandlerOptions

setInsertJSESSIONID

  • Whether to insert a JSESSIONID cookie so load-balancers ensure requests for a specific SockJS session are always routed to the correct server.

    Defaults to true.

    Parameters

    • insertJSESSIONID: boolean

    Returns SockJSHandlerOptions

setLibraryURL

  • Transports which don't support cross-domain communication natively use an iframe trick. A simple page is served from the SockJS server (using its foreign domain) and is placed in an invisible iframe.

    Code run from this iframe doesn't need to worry about cross-domain issues, as it's being run from domain local to the SockJS server. This iframe also does need to load SockJS javascript client library, and this option lets you specify its URL.

    Parameters

    • libraryURL: string

    Returns SockJSHandlerOptions

setLocalWriteHandler

  • Whether the writeHandler should be local only or cluster-wide.

    Defaults to true.

    Parameters

    • localWriteHandler: boolean

    Returns SockJSHandlerOptions

setMaxBytesStreaming

  • Most streaming transports save responses on the client side and don't free memory used by delivered messages. Such transports need to be garbage-collected once in a while.

    This setting controls the maximum number of bytes that can be sent over a single HTTP streaming request before it will be closed. After that the client needs to open new request. Setting this value to one effectively disables streaming and will make streaming transports to behave like polling transports.

    Defaults to 128K.

    Parameters

    • maxBytesStreaming: number

    Returns SockJSHandlerOptions

setOrigin

  • Set the origin to be verified before a websocket upgrade happens.

    Defaults to null.

    Parameters

    • origin: string

    Returns SockJSHandlerOptions

setRegisterWriteHandler

  • Whether a writeHandler should be registered on the {@link EventBus}.

    Defaults to false.

    Parameters

    • registerWriteHandler: boolean

    Returns SockJSHandlerOptions

setSessionTimeout

  • Set the delay before the server sends a close event when a client receiving connection has not been seen for a while.

    Defaults to 5 seconds.

    Parameters

    • sessionTimeout: number

    Returns SockJSHandlerOptions

Generated using TypeDoc