h&RMi      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred  websocketsA size limit, in bytes. The " instance takes the minimum limit. websocketsFour extension parameters are defined for "permessage-deflate" to help endpoints manage per-connection resource usage."server_no_context_takeover""client_no_context_takeover""server_max_window_bits""client_max_window_bits"  websocketsSet options for a  Connection. Please do not use this constructor directly, but rather use ) and then set the fields you want, e.g.: myOptions = defaultConnectionOptions {connectionStrictUnicode = True}This way your code does not break if the library introduces new fields. websockets Whenever a pong is received, this IO action is executed. It can be used to tickle connections or fire missiles. websocketsTimeout for connection establishment in seconds. Only used in the client. websocketsEnable . websocketsEnable strict unicode on the connection. This means that if a client (or server) sends invalid UTF-8, we will throw a UnicodeException rather than replacing it by the unicode replacement character U+FFFD. websocketsThe maximum size for incoming frame payload size in bytes. If a frame exceeds this limit, a ParseException is thrown. websocketsconnectionFrameSizeLimit is often not enough since a malicious client can send many small frames to create a huge message. This limit allows you to protect from that. If a message exceeds this limit, a ParseException is thrown.Note that, if compression is enabled, we check the size of the compressed messages, as well as the size of the uncompressed messages as we are deflating them to ensure we don't use too much memory in any case. websocketsThe default connection options:(Nothing happens when a pong is received.Compression is disabled.Lenient unicode decoding./30 second timeout for connection establishment.  Safe-Inferred"%&   Safe-Inferred"6 websockets8Error in case of failed handshake. Will be thrown as an .TODO: This should probably be in the Handshake module, and is solely here to prevent a cyclic dependency. websocketsWe don't have a match for the protocol requested by the client. todo: version parameter websocketsThe request was somehow invalid (missing headers or wrong security token)  websocketsThe servers response was somehow invalid (missing headers or wrong security token)! websocketsThe request was well-formed, but the library user rejected it. (e.g. "unknown path")" websocketsThe connection timed out# websocketsfor example "EOF came too early" (which is actually a parse error) or for your own errors. (like "unknown path"?)$ websocketsA response including a body& websocketsHTTP response, without body.+ websocketsA request with a body- websockets2An HTTP request. The request body is not yet read.2 websocketsRequest headers websocketsParse an initial request websocketsEncode an HTTP upgrade response websocketsAn upgrade response websockets Bad request websocketsHTTP response parser websocketsGet the Sec-WebSocket-Version header3 websocketsList of subprotocols specified by the client, in order of preference. If the client did not specify a list of subprotocols, this will be the empty list. websocketsGet the Sec-WebSocket-Extensions header$ !"#$%&'()*+,-./0123  Safe-Inferred"t websockets3A mask is sequence of 4 bytes. We store this in a % in the host's native byte ordering. websockets Parse a mask. websockets Encode a mask websocketsCreate a random mask websocketsMask a lazy bytestring. Uses  under the hood.  Safe-Inferred64 websocketsVarious exceptions that can occur while receiving or transmitting messages5 websocketsThe peer has requested that the connection be closed, and included a close code and a reason for closing. When receiving this exception, no more messages can be sent. Also, the server is responsible for closing the TCP connection once this exception is received.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.6 websocketsThe peer unexpectedly closed the connection while we were trying to receive some data. This is a violation of the websocket RFC since the TCP connection should only be closed after sending and receiving close control messages.7 websocketsThe client sent garbage, i.e. we could not parse the WebSockets stream.8 websocketsThe client sent invalid UTF-8. Note that this exception will only be thrown if strict decoding is set in the connection options.9 websocketsIn order to have an even more high-level API, we define a typeclass for values the user can receive from and send to the socket. A few warnings apply:)Natively, everything is represented as a $, so this is the fastest instanceYou should only use the  or the  instance when you are sure that the data is UTF-8 encoded (which is the case for > messages).Messages can be very large. If this is the case, it might be inefficient to use the strict  and  instances.= websockets.For an end-user of this library, dealing with Frames would be a bit low-level. This is why define another type on top of it, which represents data for the application layer.There are currently two kinds of data messages supported by the WebSockets protocol:Textual UTF-8 encoded data. This corresponds roughly to sending a String in JavaScript.Binary data. This corresponds roughly to send an ArrayBuffer in JavaScript.> websockets%A textual message. The second field might contain the decoded UTF-8 text for caching reasons. This field is computed lazily so if it's not accessed, it should have no performance impact.? websocketsA binary message.@ websocketsDifferent control messagesD websockets=The kind of message a server application typically deals withF websocketsReserved bits, actual message websocketsReplace an invalid input byte with the Unicode replacement character U+FFFD. websockets1Throw an error if there is an invalid input byte. !"#487569<;:=>?@ABCDEF Safe-InferredG websockets4Lightweight abstraction over an input/output stream. websocketsState of the streamH websocketsCreate a stream from a "receive" and "send" action. The following properties apply:Regardless of the provided "receive" and "send" functions, reading and writing from the stream will be thread-safe, i.e. this function will create a receive and write lock to be used internally.$Reading from or writing to a closed G will always throw an exception, even if the underlying "receive" and "send" functions do not (we do the bookkeeping). Streams should always be closed.H websocketsReading websocketsWriting websocketsResulting streamGHIJKLMNGHIJLKMN  Safe-Inferred"6! websocketsResult of demultiplexing websockets(Internal state used by the demultiplexer websockets3Thrown if the client sends invalid multiplexed data websocketsThe type of a frame. Not all types are allowed for all protocols. websockets0A low-level representation of a WebSocket packet  Safe-Inferred"! websockets Parse a frame  Safe-Inferred! OPQR Safe-Inferred"S websocketsAn extension is currently allowed to set extra headers and transform the parse/write functions of  Connection.This type is very likely to change as other extensions are introduced. STUVWX XSTUVW Safe-Inferred# Safe-Inferred"%&&n websocketsConvert the parameters to an 9 that we can put in a 'Sec-WebSocket-Extensions' header. websocketsIf the window_bits parameter is set to 8, we must set it to 9 instead.Related issues: -  )https://github.com/haskell/zlib/issues/11 - (https://github.com/madler/zlib/issues/94Quote from zlib manual:For the current implementation of deflate(), a windowBits value of 8 (a window size of 256 bytes) is not supported. As a result, a request for 8 will result in 9 (a 512-byte window). In that case, providing 8 to inflateInit2() will result in an error when the zlib header with 9 is checked against the initialization of inflate(). The remedy is to not use 8 with deflateInit2() with this initialization, or at least in that case use 9 with inflateInit2().   Safe-Inferred"Receive a message, converting it to whatever format is needed.| websocketsSend a D. This allows you send both human-readable text and binary data. This is a slightly more low-level interface than ~ or .} websocketsSend a collection of D)s. This is more efficient than calling | many times.~ websocketsSend a textual message. The message will be encoded as UTF-8. This should be the default choice for human-readable text-based protocols such as JSON. websocketsSend a number of textual messages. This is more efficient than calling ~ many times. websocketsSend a binary message. This is useful for sending binary blobs, e.g. images, data encoded with MessagePack, images... websocketsSend a number of binary messages. This is more efficient than calling  many times. websocketsSend a friendly close message. Note that after sending this message, you should still continue calling y to process any in-flight messages. The peer will eventually respond with a close control message of its own which will cause y to throw the 5 exception. This exception is when you can finally consider the connection closed. websockets:Send a friendly close message and close code. Similar to , you should continue calling y until you receive a 5 exception.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes. websockets Send a ping websockets Send a pong websockets2Forks a ping thread, sending a ping message every n seconds over the connection. The thread is killed when the inner IO action is finished.This is useful to keep idle connections open through proxies and whatnot. Many (but not all) proxies have a 60 second default timeout, so based on that sending a ping every 30 seconds is a good idea."Note that usually you want to use 6 to timeout the connection if a pong is not received. websocketsDEPRECATED: Use  instead.2Forks a ping thread, sending a ping message every n seconds over the connection. The thread dies silently if the connection crashes or is closed.This is useful to keep idle connections open through proxies and whatnot. Many (but not all) proxies have a 60 second default timeout, so based on that sending a ping every 30 seconds is a good idea. websockets5Use this if you want to run the ping thread yourself. See also .v websocketsConnection to reject websockets#Params on how to reject the requestw websocketsConnection to reject websocketsRejection response body websockets.Second interval in which pings should be sent. websockets!Repeat this after sending a ping. websockets'Application to wrap with a ping thread. websockets5Executes application and kills ping thread when done. YZ^[\]_`abcedfghijklmonpqrstuvwxyz{|}~lmonpqshijkrtwbcedfguvYZ^[\]_`a xyz{|}~   Safe-Inferred? websocketsOptions for ping-pongMake sure that the ping interval is less than the pong timeout, for example N/2. websocketsInterval in seconds websocketsTimeout in seconds websockets&Action to perform after sending a ping websocketsException type used to kill connections if there is a pong timeout. websocketsDefault options for ping-pong/Ping every 15 seconds, timeout after 30 seconds websocketsRun an application with ping-pong enabled. Raises PongTimeout if a pong is not received.,Can used with Client and Server connections.   Safe-Inferred"E websockets>WebSockets application that can be ran by a server. Once this  action finishes, the underlying socket is closed automatically. websocketsProvides a simple server. This function blocks forever. Note that this is merely provided for quick-and-dirty or internal applications, but for real applications, you should use a real server. For example:*Performance is reasonable under load, but:.No protection against DoS attacks is provided.No logging is performed....=Glue for using this package with real servers is provided by: 2https://hackage.haskell.org/package/wai-websockets 3https://hackage.haskell.org/package/websockets-snap websockets A version of , which allows you to customize some options. websocketsCustomizable version of . Never returns until killed.Please use the  combined with record updates to set the fields you want. This way your code is unlikely to break on future changes. websocketsCreate a standardized socket on which you can listen for incomming connections. Should only be used for a quick and dirty solution! Should be preceded by the call . websockets1Turns a socket, connected to some client, into a l. The l should be closed using q and N later. websocketsMore general version of  for G instead of a . websocketsAddress to bind websocketsPort to listen on websockets Application websockets Never returns Safe-InferredK websocketsA client application interacting with a single server. Once this  action finished, the underlying socket is closed automatically. websockets Build a new Y! from the client's point of view.WARNING: Be sure to call N on the given G after you are done using the Y8 in order to properly close the communication channel. 7 handles this for you, prefer to use it when possible. websockets,Check the response from the server. Throws # on failure websocketsBuild a Y from a pre-established stream with already finished handshake.NB(: this will not perform any handshaking. websocketsHost websocketsPort websocketsPath websocketsClient application websocketsHost websocketsPort websocketsPath websocketsOptions websocketsCustom headers to send websocketsClient application websocketsStream websocketsHost websocketsPath websocketsConnection options websocketsCustom headers to send websocketsClient application websockets$Stream that will be used by the new Y. websocketsHost websocketsPath websocketsConnection options websocketsCustom headers to send websocketsSocket websocketsHost websocketsPath websocketsOptions websocketsCustom headers to send websocketsClient application OPQR ROPQ Safe-InferredL'  !"#$%&'()*+,-./0123487569<;:=>?@ABCDEFYbcedfghijklorstuvwxyz{|}~loshijkrtwbcedfguvY   xyz{|}~2+,-./013$%&'()*DEF@ABC=>?9<;: !"#48756  !"#$%&'()**+,- . / 0 1 2 3 4 5 5 6 6 7 8 9 : : ; ; < = > ? @ A B C D E F G H I J K L M N O P Q M JRSTUVWXYZ[\]^^_`abccdefghijkklmnoppqrsstuvwxyz{|}~                   KK                                     ]*websockets-0.13.0.0-AmSvFfGhq0iGrxaaHcwjEkNetwork.WebSockets.ConnectionNetwork.WebSockets.ExtensionsNetwork.WebSocketsNetwork.WebSockets.StreamNetwork.WebSockets.Client&Network.WebSockets.Connection.PingPong%Network.WebSockets.Connection.Options)Network.WebSockets.Extensions.DescriptionNetwork.WebSockets.HttpNetwork.WebSockets.Hybi13.MaskNetwork.WebSockets.Types%Network.WebSockets.Hybi13.DemultiplexNetwork.WebSockets.Hybi13Network.WebSockets.Protocol+Network.WebSockets.Extensions.StrictUnicode/Network.WebSockets.Extensions.PermessageDeflate withPingPongNetwork.WebSockets.ServerNetwork.Socket withSocketsDo SizeLimit NoSizeLimitPermessageDeflateserverNoContextTakeoverclientNoContextTakeoverserverMaxWindowBitsclientMaxWindowBitspdCompressionLevelCompressionOptions NoCompressionPermessageDeflateCompressionConnectionOptionsconnectionOnPongconnectionTimeoutconnectionCompressionOptionsconnectionStrictUnicodeconnectionFramePayloadSizeLimitconnectionMessageDataSizeLimitdefaultConnectionOptionsdefaultPermessageDeflateExtensionDescriptionsExtensionDescriptionextName extParamsparseExtensionDescriptionsHandshakeException NotSupportedMalformedRequestMalformedResponseRequestRejectedConnectionTimeoutOtherHandshakeExceptionResponse ResponseHead responseCoderesponseMessageresponseHeadersRequest RequestHead requestPathrequestHeaders requestSecureHeadersgetRequestSubprotocolsConnectionException CloseRequestConnectionClosedParseExceptionUnicodeExceptionWebSocketsDatafromDataMessagefromLazyByteStringtoLazyByteString DataMessageTextBinaryControlMessageClosePingPongMessageStream makeStreammakeSocketStreammakeEchoStreamparseBinparsewritecloseProtocolHybi13defaultProtocol createRequest Extension extHeadersextParseextWriteNegotiateExtension ConnectionconnectionOptionsconnectionTypeconnectionProtocolconnectionHeartbeatconnectionParseconnectionWriteconnectionSentClose RejectRequest rejectCode rejectMessage rejectHeaders rejectBody AcceptRequestacceptSubprotocol acceptHeadersPendingConnectionpendingOptionspendingRequestpendingOnAccept pendingStreamdefaultAcceptRequest acceptRequestacceptRequestWithdefaultRejectRequestrejectRequestWith rejectRequestreceivereceiveDataMessage receiveDatasendsendDataMessagesendDataMessages sendTextData sendTextDatassendBinaryDatasendBinaryDatas sendClose sendCloseCodesendPingsendPongwithPingThreadforkPingThread pingThreadPingPongOptions pingInterval pongTimeout pingAction PongTimeoutdefaultPingPongOptions$fExceptionPongTimeout$fShowPongTimeout ServerOptions serverHost serverPortserverConnectionOptions ServerApp runServer runServerWithdefaultServerOptionsrunServerWithOptionsmakeListenSocketmakePendingConnectionmakePendingConnectionFromStream ClientApp runClient runClientWithrunClientWithStreamnewClientConnectioncheckServerResponsestreamToClientConnectionrunClientWithSocketbaseGHC.BaseMonoidatMostSizeLimitExtensionParamencodeExtensionDescriptionsGHC.Exception.Type ExceptiondecodeRequestHeadencodeResponseHead response101 response400decodeResponseHeadgetRequestSecWebSocketVersion getRequestSecWebSocketExtensionsencodeRequestHead encodeRequestencodeResponsedecodeResponsegetRequestHeadergetResponseHeaderMaskGHC.WordWord32 parseMask encodeMask randomMask maskPayload c_mask_chunkbytestring-0.11.3.1Data.ByteString.Lazy.Internal ByteString text-1.2.5.0Data.Text.Internal.LazyData.Text.InternalData.ByteString.InternaldecodeUtf8LenientdecodeUtf8StrictConnectionTypeServerConnectionClientConnection StreamStateDemultiplexResultDemultiplexStateDemultiplexException FrameTypeFrameDemultiplexSuccessDemultiplexErrorDemultiplexContinueContinuationFrame TextFrame BinaryFrame CloseFrame PingFrame PongFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex parseFrameheaderVersions finishRequestfinishResponse encodeMessageencodeMessages encodeFramedecodeMessages protocols compatible strictUnicodetoExtensionDescription fixWindowBitsnegotiateDeflatemakeMessageDeflatermakeMessageInflater sendResponseghc-prim GHC.TypesIO%network-3.1.4.0-B2siKM4RZ608EJIWCrOTuNetwork.Socket.TypesSocket