||Some protocols, such as Websockets, may be embedded within HTTP. The initial connection and handshake begins as HTTP, but then switches to a non-HTTP, non-HTML protocol. Some Microsoft applications, Java, and binary protocols use this method to tunnel through HTTP. With the
avi.http.disable() function, a DataScript can monitor the client to server handshake over HTTP, then disable HTTP process when the protocol switches to non-HTTP.
Note that Websocket support may be enabled natively via an HTTP profile. However, some application protocols use slightly different variation of the names of the headers, which is when the DataScript becomes a requirement.
avi.http.disable() function may be invoked during the HTTP response event. The Service Engine will send the server's response to the client, then upgrade (disable) HTTP processing for the current connection, which will subsequently be treated as layer 4 TCP. If SSL termination is being performed, this will continue without interruption. HTTP processing may not be turned on again for the connection.
||HTTP Request Event
HTTP Response Event
if string.lower(avi.http.get_header("Upgrade")) == "websocket" and string.lower(avi.http.get_header("Connection") == "upgrade" then
if avi.http.get_reqvar("var") == 1 then
Updated: 2018-01-18 11:22:22 +0000