<}X      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX*ByteString should be exactly 4 bytes long Y Apply mask ZCreate a random mask XYZXYZ[Behaves almost the same as the  iterParser function from the L attoparsec-enumerator package, with the exception that, while the iteratee  created by  iterParser always starts in a Continue state, this one will ? only ask for more data if the underlying parser needs it. That' s important H because e.g. network connection will block and wait for more data on a  ContinueC. For messages or frames the problem will not occur as we know the K length of the payload and therefore can determine EOF (= end of the frame  here). We use parsers that don'/t take data for validation in Protocols.Hybi10 [[HIn order to have an even more high-level API, we define a typeclass for I 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 instance  You should only use the ] or the ^ instance when you are > sure that the data is UTF-8 encoded (which is the case for   messages). M Messages can be very large. If this is the case, it might be inefficient to  use the strict _ and ^ instances. .For an end-user of this library, dealing with s would be a bit K low-level. This is why define another type on top of it, which represents ! data for the application layer. Different control messages  >The kind of message a server application typically deals with BThe type of a frame. Not all types are allowed for all protocols. 1A low-level representation of a WebSocket packet The connection couldn'4t be established or broke down unexpectedly. thrown  as an iteratee exception. 'the client closed the connection while & we were trying to receive some data. "todo: Also want this for sending.  The client sent malformed data. `The inverse of a parser aAn alias so we don''t have to import attoparsec everywhere  `a   `abcdefbcdefbcdefAError in case of failed handshake. Will be thrown as an iteratee  exception. (g condition). MTODO: This should probably be in the Handshake module, and is solely here to  prevent a cyclic dependency.  for example EOF came too early# (which is actually a parse error)  or for your own errors. (like  unknown path?) ?The request was well-formed, but the library user rejected it.  (e.g.  unknown path) CThe request was somehow invalid (missing headers or wrong security  token) We don'9t have a match for the protocol requested by the client.  todo: version parameter !Response to a (' "#$%&'Full request type ()*+,3(Internally used) HTTP headers and requested path. -./0Request headers hParse an initial request i Encode an HTTP upgrade response jAn upgrade response k Bad request  !"#$%&'()*+,-./0hijk  !"#$%&"#$%&'()*+()*+,-./-./0hijk123lUnique identifier for us. mVersion as used in the Sec-WebSocket-Version  header. This is usually ! not the same, or derivable from version, e.g. for hybi10, it's 8. nopEParse and validate the rest of the request. For hybi10, this is just . validation, but hybi00 also needs to fetch a security token HTodo: Maybe we should introduce our own simplified error type here. (to 3 be amended with the RequestHttpPart for the user) q%Implementations of the specification 4Construct a close message 5Construct a ping message 6Construct a pong message 7Construct a text message 8Construct a binary message 123lmnopq45678123lmnopqlmnopq45678rstuvwrsrss xyzParse a frame {Encode a frame |xyxyy }~}~}~~ 9rs99 ::: ;;;*Receives and checks the client handshake. I If this fails, we encountered a syntax error while processing the client's  request. That is very bad.  If it returns Left, we either don'$t support the protocol requested by  the client ( #) or the data the client sent doesn' t match the  protocol () J Otherwise, we are guaranteed that the client handshake is valid and have - generated a response ready to be sent back. FRespond to errors encountered during handshake. First argument may be  bottom.  )Internal state used by the demultiplexer '<Used for asynchronous sending. =@The monad in which you can write WebSocket-capable applications Environment in which the = monad actually runs >"Options for the WebSocket program ?@ADefault options B9Receives the initial client handshake, then behaves like D. C9Receives the initial client handshake, then behaves like  E. DRun a = application on an 'Enumerator'/'Iteratee' pair, given L that you (read: your web server) has already received the HTTP part of the 0 initial request. If not, you might want to use C  instead. "If the handshake failed, throws a . Otherwise, executes the G supplied continuation. You should still send a response to the client  yourself. E Version of D, which allows you to specify custom options FspawnPingThread n* spawns a thread which sends a ping every n seconds M (if the protocol supports it). To be called after having sent the response. AReceive some data from the socket, using a user-supplied parser. Underlying iteratee version of . ILike receiveIteratee, but if the supplied parser is happy with no input,  we don'Et supply any more. This is very, very important when we have parsers  that don'$t necessarily read data, like hybi10's completeRequest. 3Execute an iteratee, wrapping attoparsec-enumeratee's ParseError into the 6 ParseError constructor (which is a ConnectionError). $Low-leven sending with an arbitrary ` G$Low-level sending with an arbitrary   HHSend a message to a sink. Might generate an exception if the underlying  connection is closed. IHIn case the user of the library wants to do asynchronous sending to the  socket, he can extract a <* and pass this value around, for example,  to other threads. Get the current configuration Get the underlying protocol J Find out the = version used at runtime K0Throw an iteratee error in the WebSockets monad L0Catch an iteratee error in the WebSockets monad +Lift an Iteratee computation to WebSockets <=>?@ABCDEFGHIJKL<=>?@?@ABCDEFGHIJKLMGProvides a simple server. This function blocks forever. Note that this J is merely provided for quick-and-dirty standalone applications, for real - applications, you should use a real server. Address to bind to Port to listen on Application to serve Never returns NThis function wraps D& in order to provide a simple API for  stand-alone servers. ECreate an enumerator which reads from a socket and yields the chunks ,Create an iterator which writes to a socket MNMN ORead a ; from the socket. Blocks until a frame is received. If the  socket is closed, throws ConnectionClosed (a ConnectionError) ANote that a typical library user will want to use something like  receiveByteStringData instead. PReceive a message QKReceive an application message. Automatically respond to control messages. R5Receive a message, treating it as data transparently Send a "! to the socket immediately. S?A low-level function to send an arbitrary frame over the wire. TSend a text message USend some binary data VKReject a request, sending a 400 (Bad Request) to the client and throwing a " RequestRejected (HandshakeError) WHAccept a request. After this, you can start sending and receiving data. X  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX>?@A=DEBC3219:;MN0,-./'()*+!"#$%&   WVJOPQRSGTU<HI45678FKL  OPQRSTUVW !"#$$%&'()*+,-./0012345567899:;<=>?@ABCD E F GHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkjlgmino@ABCDpqrstuvwxyz{|}}~     E F GHIwebsockets-0.4.0.1Network.WebSocketsNetwork.WebSockets.Mask*Network.WebSockets.Handshake.ShyIterParserNetwork.WebSockets.Types"Network.WebSockets.Protocol.Unsafe!Network.WebSockets.Handshake.HttpNetwork.WebSockets.Protocol+Network.WebSockets.Protocol.Hybi00.Internal+Network.WebSockets.Protocol.Hybi10.Internal+Network.WebSockets.Protocol.Hybi17.Internal"Network.WebSockets.Protocol.Hybi00"Network.WebSockets.Protocol.Hybi10"Network.WebSockets.Protocol.Hybi17Network.WebSockets.HandshakeNetwork.WebSockets.DemultiplexNetwork.WebSockets.MonadNetwork.WebSockets.SocketWebSocketsDatafromLazyByteStringtoLazyByteString DataMessageBinaryTextControlMessagePongPingCloseMessage FrameType PongFrame PingFrame CloseFrame BinaryFrame TextFrameContinuationFrameFrameframeFin frameType framePayloadConnectionErrorConnectionClosed ParseErrorHandshakeErrorOtherHandshakeErrorRequestRejectedMalformedRequest NotSupportedResponse responseCoderesponseMessageresponseHeaders responseBodyRequest requestPathrequestHeadersrequestResponseRequestHttpPartrequestHttpPathrequestHttpHeadersHeadersBinaryProtocol TextProtocolProtocolclosepingpongtextData binaryDataHybi00Hybi10Hybi17Sink WebSocketsWebSocketsOptionsonPongdefaultWebSocketsOptionsrunWebSocketsHandshakerunWebSocketsWithHandshake runWebSocketsrunWebSocketsWithspawnPingThreadsendsendSinkgetSink getVersion throwWsError catchWsError runServer runWithSocket receiveFramereceivereceiveDataMessage receiveData sendFrame sendTextDatasendBinaryData rejectRequest acceptRequestMask maskPayload randomMask shyIterParserbytestring-0.9.2.0Data.ByteString.Lazy.Internal ByteString text-0.11.1.9Data.Text.Lazy.InternalData.Text.InternalData.ByteString.InternalEncoderDecodertransformers-0.2.2.0Control.Monad.Trans.ErrorError decodeRequestencodeResponse response101 response400version headerVersion encodeFrame decodeFrame finishRequestimplementationsHybi00_encodeFrameHybi00decodeFrameHybi00 divBySpaceshandshakeHybi00Hybi10_decodeFrameHybi10encodeFrameHybi10handshakeHybi10Hybi17_tryFinishRequest responseErrorDemultiplexStateunDemultiplexStateemptyDemultiplexState demultiplexunSink unWebSockets WebSocketsEnvoptions sendBuilderprotocolrunWebSocketsWith' receiveWithreceiveIterateereceiveIterateeShywrappingParseError sendIterateesendWithmkSend singleton builderSender getOptions getProtocol liftIteratee receiveEnumsendIter sendResponsefailHandshakeWith