h$JQE@      !"#$%&'()*+,-./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. 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.  Safe-Inferred #$ $None 3 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")! 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.0 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 header1 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# !"#$%&'()*+,-./01 None d 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. None32 websocketsVarious exceptions that can occur while receiving or transmitting messages3 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.4 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.5 websocketsThe client sent garbage, i.e. we could not parse the WebSockets stream.6 websocketsThe client sent invalid UTF-8. Note that this exception will only be thrown if strict decoding is set in the connection options.7 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 messagesB websockets=The kind of message a server application typically deals withD 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. !265347:98;=<>?@ABCDNone_E websockets4Lightweight abstraction over an input/output stream.F 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 or to a closed E will always throw an exception, even if the underlying "receive" and "send" functions do not (we do the bookkeeping). Streams should always be closed.F websocketsReading websocketsWriting websocketsResulting streamEFGHIJKLEFGHJIKL None 3 websocketsResult of demultiplexing websockets(Internal state used by the demultiplexer websocketsThe type of a frame. Not all types are allowed for all protocols. websockets0A low-level representation of a WebSocket packet None  websockets Parse a frame  None ' MNOPNone!)Q 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. QRSTUV VQRSTUNone!^None #$!  None 6^ websocketsAccording to the RFC, both the client and the server MUST send a close control message to each other. Either party can initiate the first close message but then the other party must respond. Finally, the server is in charge of closing the TCP connection. This IORef tracks if we have sent a close message and are waiting for the peer to respond._ websocketsParameters that allow you to tweak how a request is rejected. Please use r and modify fields using record syntax so your code will not break when new fields are added.a websockets The status code, 400 by default.b websockets%The message, "Bad Request" by defaultc websockets+Extra headers to be sent with the response.d websocketsReponse body of the rejection.e websockets,This datatype allows you to set options for q&. It is strongly recommended to use o and then modify the various fields, that way new fields introduced in the library do not break your code.g websockets.The subprotocol to speak with the client. If pendingSubprotcols is non-empty, g0 must be one of the subprotocols from the list.h websockets(Extra headers to send with the response.i websocketsA new client connected to the server. We haven't accepted the connection yet, though.k websocketsOptions, passed as-is to the Wl websockets,Useful for e.g. inspecting the request path.m websocketsOne-shot callback fired when a connection is accepted, i.e., *after* the accepting response is sent to the client.n websocketsInput/output streamp websockets/Accept a pending connection, turning it into a W.q websocketsThis function is like p1 but allows you to set custom options using the e datatype.v websocketsReceive an application message. Automatically respond to control messages.When the peer sends a close control message, an exception of type 3 is thrown. The peer can send a close control message either to initiate a close or in response to a close message we have sent to the peer. In either case the 3 exception will be thrown. The RFC specifies that the server is responsible for closing the TCP connection, which should happen after receiving the 3 exception from this function.This will throw 4) if the TCP connection dies unexpectedly.w websockets>Receive a message, converting it to whatever format is needed.y websocketsSend a ;. This allows you send both human-readable text and binary data. This is a slightly more low-level interface than { or }.z websocketsSend a collection of ;)s. This is more efficient than calling y 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 v to process any in-flight messages. The peer will eventually respond with a close control message of its own which will cause v to throw the 3 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 v until you receive a 3 exception.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes. websockets Send a ping 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. 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 .s websocketsConnection to reject websockets#Params on how to reject the requestt 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. WXYZ[\]^_`bacdefghijlkmnopqrstuvwxyz{|}~ijlkmnpefghoqt_`bacdrsWXYZ[\]^ uvwxyz{|}~  None =  websocketsInternally used exception type used to kill connections if there is a pong timeout. websocketsRequire a pong from the client every N seconds; otherwise kill the connection. If you use this, you should also use 8 to send a ping at a smaller interval; for example N/2. 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 i. The i should be closed using L later. websocketsMore general version of  for E instead of a . websocketsAddress to bind websocketsPort to listen on websockets Application websockets Never returnsNoneC websocketsA client application interacting with a single server. Once this  action finished, the underlying socket is closed automatically. websockets Build a new W! from the client's point of view.WARNING: Be sure to call L on the given E after you are done using the W8 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 W 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 W. websocketsHost websocketsPath websocketsConnection options websocketsCustom headers to send websocketsSocket websocketsHost websocketsPath websocketsOptions websocketsCustom headers to send websocketsClient application MNOP PMNONoneD   !"#$%&'()*+,-./01265347:98;=<>?@ABCDW_`bacdefghilopqrstuvwxyz{|}~ilpefghoqt_`bacdrsW   uvwxyz{|}~0)*+,-./1"#$%&'(BCD>?@A;=<7:98 !26534 !"#$%&''()*+,-./01122345667789:;< = > ? @ A B C D E F G H I J K L M I FNOPQRSTU V W X YZZ[\]^__`abcdeffghijkklmnnopqrstuvwxyz{|}~      GG                                    Y       *websockets-0.12.7.3-BNAIFXwFR887mlNDV1tiQgNetwork.WebSockets.ConnectionNetwork.WebSockets.ExtensionsNetwork.WebSocketsNetwork.WebSockets.StreamNetwork.WebSockets.Client%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.PermessageDeflateNetwork.WebSockets.ServerNetwork.Socket withSocketsDo SizeLimit NoSizeLimitPermessageDeflateserverNoContextTakeoverclientNoContextTakeoverserverMaxWindowBitsclientMaxWindowBitspdCompressionLevelCompressionOptions NoCompressionPermessageDeflateCompressionConnectionOptionsconnectionOnPongconnectionCompressionOptionsconnectionStrictUnicodeconnectionFramePayloadSizeLimitconnectionMessageDataSizeLimitdefaultConnectionOptionsdefaultPermessageDeflateExtensionDescriptionsExtensionDescriptionextName extParamsparseExtensionDescriptionsHandshakeException NotSupportedMalformedRequestMalformedResponseRequestRejectedOtherHandshakeExceptionResponse ResponseHead responseCoderesponseMessageresponseHeadersRequest RequestHead requestPathrequestHeaders requestSecureHeadersgetRequestSubprotocolsConnectionException CloseRequestConnectionClosedParseExceptionUnicodeExceptionWebSocketsDatafromDataMessagefromLazyByteStringtoLazyByteString DataMessageTextBinaryControlMessageClosePingPongMessageStream makeStreammakeSocketStreammakeEchoStreamparseBinparsewritecloseProtocolHybi13defaultProtocol createRequest Extension extHeadersextParseextWriteNegotiateExtension ConnectionconnectionOptionsconnectionTypeconnectionProtocolconnectionParseconnectionWriteconnectionSentClose RejectRequest rejectCode rejectMessage rejectHeaders rejectBody AcceptRequestacceptSubprotocol acceptHeadersPendingConnectionpendingOptionspendingRequestpendingOnAccept pendingStreamdefaultAcceptRequest acceptRequestacceptRequestWithdefaultRejectRequestrejectRequestWith rejectRequestreceivereceiveDataMessage receiveDatasendsendDataMessagesendDataMessages sendTextData sendTextDatassendBinaryDatasendBinaryDatas sendClose sendCloseCodesendPingwithPingThreadforkPingThread pingThread ServerOptions serverHost serverPortserverConnectionOptionsserverRequirePong ServerApp runServer runServerWithdefaultServerOptionsrunServerWithOptionsmakeListenSocketmakePendingConnectionmakePendingConnectionFromStream ClientApp runClient runClientWithrunClientWithStreamnewClientConnectioncheckServerResponsestreamToClientConnectionrunClientWithSocketbaseGHC.BaseMonoidatMostSizeLimitExtensionParamencodeExtensionDescriptionsGHC.Exception.Type ExceptiondecodeRequestHeadencodeResponseHead response101 response400decodeResponseHeadgetRequestSecWebSocketVersion getRequestSecWebSocketExtensionsencodeRequestHead encodeRequestencodeResponsedecodeResponsegetRequestHeadergetResponseHeaderMaskGHC.WordWord32 parseMask encodeMask randomMask maskPayload c_mask_chunkbytestring-0.10.10.0Data.ByteString.Lazy.Internal ByteString text-1.2.3.2Data.Text.Internal.LazyData.Text.InternalData.ByteString.InternaldecodeUtf8LenientdecodeUtf8StrictConnectionTypeServerConnectionClientConnectionDemultiplexResultDemultiplexState FrameTypeFrameDemultiplexSuccessDemultiplexErrorDemultiplexContinueContinuationFrame TextFrame BinaryFrame CloseFrame PingFrame PongFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex parseFrameheaderVersions finishRequestfinishResponse encodeMessageencodeMessages encodeFramedecodeMessages protocols compatible strictUnicodenegotiateDeflatemakeMessageDeflatermakeMessageInflater PongTimeoutghc-prim GHC.TypesIO&network-3.1.2.5-2Vz02yBEZWw9nGPVmJXcnkNetwork.Socket.TypesSocket