pipes-websockets-0.1.0.0: WebSockets in the Pipes framework.

Safe HaskellNone
LanguageHaskell2010

Pipes.WebSockets.Examples

Description

Examples of usage. In this module we implement a few standard ways one may wish to use this library.

Synopsis

Documentation

echoStdInOut Source

Arguments

:: String

Server to connect to

-> Int

Port

-> String

Path from the server, i.e. "/".

-> IO () 

Uses Pipes.Concurrent to start up threads for reading from and writing to a single WebSocket connection. Input to send is read from stdin and response are written to stdout.

Try it out on echo.websocket.org with:

-- wsTest.hs
module Main where 

import Pipes.WebSockets.Examples

main :: IO ()
main = echoStdInOut "echo.websocket.org" 80 "/"