Popularity
3.9
Growing
Activity
0.0
Stable
6
3
1

Monthly Downloads: 11
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Language     Ghci    
Latest version: v0.0.2
Add another 'ghci' Package

README

ghci-websockets

With ghci-websockets you can send data from GHCi straight to the browser, using a websocket connection that survives GHCi reloads.

[ghci-websockets.gif](ghci-websockets.gif)

Contents

The Ghci.Server.Websockets module implements the actual websocket server, sending JSON objects to all clients. Ghci.Server.Http servers the index.html page that goes with the messages defined in Ghci.Websockets.Message.

Quickstart

  • Add ghci-websockets to the build-depends field of your .cabal file
  • Run cabal new-repl
  • Run Ghci.Server.start
  • Open localhost:3000 in a browser
  • In GHCi, run Ghci.Server.sendText "hello" (see also sendHtml and sendPlot from the same module). You may need :set -XOverloadedStrings.

Warning

This packages uses the foreign-store package internally, which is highly unstable. I wouldn't use ghci-websockets for anything other than GHCi.

License

BSD-3-Clause, see LICENSE

Contributions

Bug reports, pull requests etc. are welcome!


*Note that all licence references and agreements mentioned in the ghci-websockets README section above are relevant to that project's source code only.