homepage: https://git.sr.ht/~jack/libtelnet-haskell
changelog-type: markdown
hash: f9b136d4bc3209b173c08bb414781787fa8fc6d0abae88d8031fad238fb0554a
test-bench-deps: {}
maintainer: jack@jackkelly.name
synopsis: Bindings to libtelnet
changelog: |
  # 0.1.0.0

  * Initial release.
basic-deps:
  bytestring: ! '>=0.10.6.0 && <0.11'
  base: ! '>=4.7 && <5'
all-versions:
- 0.1.0.0
author: Jack Kelly
latest: 0.1.0.0
description-type: markdown
description: |
  # Bindings to libtelnet

  This is a wrapper around
  [libtelnet](https://github.com/seanmiddleditch/libtelnet), a C library
  for handling Telnet streams, including option negotiation, &c. As a
  cleartext protocol, Telnet is thorougly unsuitable for use on the open
  internet, but you might have a niche where it makes sense:

  * [MU*](https://en.wikipedia.org/wiki/MU*) games still use it, and so
    the clients people want to use only speak Telnet,
  * You might be speaking Telnet inside a
    [stunnel](https://www.stunnel.org/), or
  * You might have some ancient hardware that can't be updated, and
    doesn't have ssh, but you want to talk to it using Haskell.

  This library hews closely to the interface provided by the C
  libtelnet, so reading the [excellent C
  documentation](https://github.com/seanmiddleditch/libtelnet#ii-api)
  will help you. The short version goes something like this:

  1. Define an _event handler_ of type
     `Network.Telnet.LibTelnet.EventHandler`. This function receives
     callbacks that tell you what received data should be propagated to
     the application, and what bytes need to be sent out over the
     socket.

  2. Pass your event handler (and some other flags) to
     `Network.Telnet.LibTelnet.telnetInit`, which will give you access
     to a `Telnet`, a garbage-collected _state tracker_.

  3. Tell the state tracker that data has arrived on the socket, or that
     you want to send data to the socket, by passing it to the library's
     other functions.

  ## Other Resources

  * A simple server example exists in
    [`example/Main.hs`](https://git.sr.ht/~jack/libtelnet-haskell/tree/master/example/Main.hs).

  * Questions should go to the
    [libtelnet-haskell-discuss](https://lists.sr.ht/~jack/libtelnet-haskell-discuss)
    mailing list.

  * Bug reports should go to the
    [bug tracker](https://todo.sr.ht/~jack/libtelnet-haskell).
license-name: GPL-3.0-or-later

Update from Hackage at 2019-02-03T07:38:23Z
Update from Hackage at 2019-02-03T07:38:23Z
