#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) using BestHTTP.WebSocket.Frames; namespace BestHTTP.WebSocket.Extensions { public interface IExtension { /// /// This is the first pass: here we can add headers to the request to initiate an extension negotiation. /// /// void AddNegotiation(HTTPRequest request); /// /// If the websocket upgrade succeded it will call this function to be able to parse the server's negotiation /// response. Inside this function the IsEnabled should be set. /// bool ParseNegotiation(WebSocketResponse resp); /// /// This function should return a new header flag based on the inFlag parameter. The extension should set only the /// Rsv1-3 bits in the header. /// byte GetFrameHeader(WebSocketFrame writer, byte inFlag); /// /// This function will be called to be able to transform the data that will be sent to the server. /// /// /// byte[] Encode(WebSocketFrame writer); /// /// This function can be used the decode the server-sent data. /// byte[] Decode(byte header, byte[] data); } } #endif