cabal-version:       2.2
name:                http-io-streams
version:             0.1.6.1

synopsis:            HTTP and WebSocket client based on io-streams
description:
  An HTTP client with WebSocket (RFC 6455) support, using the Snap Framework's [io-streams](https://hackage.haskell.org/package/io-streams) library to
  handle the streaming IO. The @http-io-streams@ API designed for ease of use when querying web services and dealing with the result as streaming I/O.
  .
  The main HTTP/1.1 part of the library is exported in a single module "Network.Http.Client"; the WebSocket specific functionality is available from the "Network.Http.Client.WebSocket" module.
  .
  __NOTE__: This package originally started as a fork of [http-streams](http://hackage.haskell.org/package/http-streams) with a lighter dependency footprint focusing on core HTTP functionality.

license:             BSD-3-Clause AND GPL-2.0-or-later
license-files:       LICENSE LICENSE.GPLv2
author:              Andrew Cowie <andrew@operationaldynamics.com>,
                     Herbert Valerio Riedel <hvr@gnu.org>
maintainer:          Herbert Valerio Riedel <hvr@gnu.org>
copyright:           © 2012-2018 Operational Dynamics Consulting, Pty Ltd and Others
category:            Web, IO-Streams
bug-reports:         https://github.com/hvr/http-io-streams/issues
extra-source-files:  CHANGELOG.md

tested-with:
  GHC == 9.2.2
  GHC == 9.0.2
  GHC == 8.10.7
  GHC == 8.8.4
  GHC == 8.6.5
  GHC == 8.4.4
  GHC == 8.2.2
  GHC == 8.0.2
  GHC == 7.10.3
  GHC == 7.8.4
  GHC == 7.6.3
  GHC == 7.4.2

source-repository    head
  type:              git
  location:          https://github.com/hvr/http-io-streams.git

flag brotli
  manual:  True
  default: True
  description: Build with support for <http://brotli.org Brotli> (<https://tools.ietf.org/html/rfc7932 RFC7932>) compression algorithm for <https://en.wikipedia.org/wiki/HTTP_compression HTTP compression>.

flag fast-xor
  manual:  True
  default: True
  description: Enable use of faster and more efficient @XOR@ routines.

common settings
  build-depends:
    , base                 >= 4.5 && < 4.17
    , blaze-builder       ^>= 0.4.1.0
    , bytestring           >= 0.10.0.0 && < 0.12
    , case-insensitive    ^>= 1.2.0.11
    , containers          ^>= 0.5.0.0 || ^>= 0.6.0.1

  default-language:  Haskell2010
  other-extensions:
    BangPatterns
    CPP
    DeriveDataTypeable
    DoAndIfThenElse
    MagicHash
    NamedFieldPuns
    OverloadedStrings
    Rank2Types
    RecordWildCards
    UnboxedTuples

  ghc-options:
    -Wall
    -fno-warn-missing-signatures
    -fno-warn-unused-binds
    -fno-warn-unused-do-bind
    -funbox-strict-fields

library
  import: settings

  -- xor
  if flag(fast-xor)
    build-depends: xor    ^>= 0.0.1.0
  else
    hs-source-dirs: xor/lib
    other-modules: Data.XOR

  -- http-streams
  if flag(brotli)
    build-depends:
      brotli-streams      ^>= 0.0.0.0

  build-depends:
    , HsOpenSSL           ^>= 0.11.2
    , attoparsec          ^>= 0.13.2.2 || ^>= 0.14.4
    , binary              ^>= 0.7.1   || ^>= 0.8.3
    , cryptohash-sha1     ^>= 0.11.100
    , directory           ^>= 1.2.0.1 || ^>= 1.3.0.0
    , io-streams          ^>= 1.5.0.1
    , network             ^>= 2.6.0.0 || ^>= 2.7.0.0 || ^>= 2.8.0.0 || ^>= 3.0.0.0 || ^>= 3.1.0.0
    , network-uri         ^>= 2.6.0.0
    , openssl-streams     ^>= 1.2.1.3
    , text                ^>= 1.2.3.0
    , transformers        ^>= 0.3.0.0 || ^>= 0.4.2.0 || ^>= 0.5.2.0

  hs-source-dirs: http-streams/lib
  exposed-modules:
    Network.Http.Client
    Network.Http.Client.WebSocket
  other-modules:
    Network.Http.Connection
    Network.Http.ResponseParser
    Network.Http.Utilities
    Network.Http.Inconvenience

  -- http-common
  build-depends:
    , base64-bytestring   ^>= 1.2.1.0
    , mtl                 ^>= 2.2.2

  hs-source-dirs: http-common/lib
  other-modules:
    Network.Http.Types
    Network.Http.RequestBuilder,
    Network.Http.Internal