hprox: a lightweight HTTP proxy server, and more

[ apache, library, program, proxy, web ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/bjin/hprox#readme


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
static

Enable static build

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.0.1, 0.1.0.2, 0.1.1, 0.1.2, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.6.1, 0.6.2
Dependencies async (>=2.2), base (>=4.12 && <5), base64-bytestring (>=1.0), binary (>=0.8), bytestring (>=0.10), case-insensitive (>=1.2), conduit (>=1.3), conduit-extra (>=1.3), http-client (>=0.5), http-client-tls (>=0.3.4), http-reverse-proxy (>=0.4.0), http-types (>=0.12), optparse-applicative (>=0.14), tls (>=1.5), unix (>=2.7), wai (>=3.2.2), wai-extra (>=3.0), warp (>=3.2.8), warp-tls (>=3.2.5) [details]
License Apache-2.0
Copyright 2019 Bin Jin
Author Bin Jin
Maintainer bjin@ctrl-d.org
Category Web
Home page https://github.com/bjin/hprox#readme
Bug tracker https://github.com/bjin/hprox/issues
Source repo head: git clone https://github.com/bjin/hprox
Uploaded by BinJin at 2019-10-17T09:30:08Z
Distributions NixOS:0.6.2
Executables hprox
Downloads 1967 total (45 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2019-10-17 [all 3 reports]

Readme for hprox-0.1.1

[back to package description]

hprox

CircleCI Depends Release Hackage License

hprox is a lightweight HTTP/HTTPS proxy server.

Features

  • Basic HTTP proxy functionality.
  • Simple password authentication.
  • TLS encryption (requires a valid certificate). Supports TLS 1.3 and HTTP/2, also known as SPDY Proxy.
  • TLS SNI validation (blocks all clients with invalid domain name).
  • Provide PAC file for easy client side configuration (supports Chrome and Firefox).
  • Websocket redirection (compatible with v2ray-plugin).
  • Reverse proxy support (redirect requests to a fallback server).
  • Implemented as a middleware, compatible with any Haskell Web Application built with wai interface. Defaults to fallback to a dumb application which simulate the default empty page from Apache.

Installation

hprox should build and work on all unix-like OS with ghc support, but it's only been tested on Linux and macOS.

stack is recommended to build hprox.

stack setup
stack install

Alternatively, you also can use the statically linked binary for the latest release.

Usage

Use hprox --help to list options with detailed explanation.

  • To run hprox on port 8080, with simple password authentication:
echo "user:pass" > userpass.txt
hprox -p 8080 -a userpass.txt
  • To run hprox with TLS encryption on port 443, with certificate of example.com obtained with certbot:
hprox -p 443 -s example.com:/etc/letsencrypt/live/example.com/fullchain.pem:/etc/letsencrypt/live/example.com/privkey.pem

Browsers can be configured with PAC file URL https://example.com/get/hprox.pac.

v2ray-plugin -server -localPort 8080 -mode websocket -host example.com -remotePort xxxx
hprox -p 443 -s example.com:fullchain.pem:privkey.pem --ws 127.0.0.1:8080 --rev archive.ubuntu.com:80

Clients will be able to connect with plugin option tls;host=example.com.

Known Issue

  • Passwords are currently stored in plain text, please set permission accordingly and avoid using existing password.

License

hprox is licensed under the Apache license. See LICENSE file for details.