All Projects → petrohi → machine_gun

petrohi / machine_gun

Licence: ISC license
HTTP/1 and HTTP/2 client for Elixir. Based on Gun and Poolboy.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to machine gun

Espresso
☕ Bridge your C# soul to the power of Javascript (V8 Javascript Engine / NodeJs)
Stars: ✭ 54 (-12.9%)
Mutual labels:  http2
http2-examples-empireconf
HTTP2 examples for EmpireConf talk
Stars: ✭ 15 (-75.81%)
Mutual labels:  http2
cashpack
A stateless event-driven HPACK codec
Stars: ✭ 25 (-59.68%)
Mutual labels:  http2
lua-resty-http2
The HTTP/2 Protocol (Client Side) Implementation for OpenResty.
Stars: ✭ 73 (+17.74%)
Mutual labels:  http2
nghttp2-alpine
Minimal nghttp2 docker image with ALPN support
Stars: ✭ 14 (-77.42%)
Mutual labels:  http2
django-http2-middleware
⚡️Django middleware to automatically send preload headers before views runs, enabling faster HTTP2 server-push (with CSP support).
Stars: ✭ 65 (+4.84%)
Mutual labels:  http2
cryptonice
CryptoNice is both a command line tool and library which provides the ability to scan and report on the configuration of SSL/TLS for your internet or internal facing web services. Built using the sslyze API and ssl, http-client and dns libraries, cryptonice collects data on a given domain and performs a series of tests to check TLS configuration…
Stars: ✭ 91 (+46.77%)
Mutual labels:  http2
hook-slinger
A generic service to send, retry, and manage webhooks.
Stars: ✭ 88 (+41.94%)
Mutual labels:  http2
jetty-load-generator
jetty-project.github.io/jetty-load-generator/
Stars: ✭ 62 (+0%)
Mutual labels:  http2
awacs
Next-gen mobile first analytics server (think Mixpanel, Google Analytics) with built-in encryption supporting HTTP2 and gRPC. Node.js, headless, API-only, horizontally scaleable.
Stars: ✭ 52 (-16.13%)
Mutual labels:  http2
phorklift
Phorklift is an HTTP server and proxy daemon, with clear, powerful and dynamic configuration.
Stars: ✭ 43 (-30.65%)
Mutual labels:  http2
Ghost-over-Caddy
This repo/script will install Ghost blog over Caddy web server as a reverse proxy.
Stars: ✭ 20 (-67.74%)
Mutual labels:  http2
next.js-boilerplate
next.js bolierplate, next.js 的开发模板
Stars: ✭ 28 (-54.84%)
Mutual labels:  http2
restio
HTTP Client for Dart inspired by OkHttp
Stars: ✭ 46 (-25.81%)
Mutual labels:  http2
gun-cassandra
Cassandra / Elassandra persistence layer for Gun DB 🔫
Stars: ✭ 14 (-77.42%)
Mutual labels:  gun
pusher
golang : HTTP2 Push Handler collection
Stars: ✭ 15 (-75.81%)
Mutual labels:  http2
th2c
Tornado HTTP/2 Client
Stars: ✭ 79 (+27.42%)
Mutual labels:  http2
http2-client
Transparently make http request to both http1 / http2 server.
Stars: ✭ 31 (-50%)
Mutual labels:  http2
restler
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.
Stars: ✭ 120 (+93.55%)
Mutual labels:  http2
3dub
www dev server with livereload, file watching, http2, https, self signed cert generation
Stars: ✭ 28 (-54.84%)
Mutual labels:  http2

Hex.pm version Hex.pm downloads Build Status

MachineGun

HTTP client for Elixir. Based on Gun and Poolboy.

  • Supports HTTP/1 and HTTP/2 with automatic detection;
  • Maintains separate connection pool for each pool_group:host:port combination;
  • Allows per-pool configuration;
  • Drop-in replacement for HTTPoison.

Example

%MachineGun.Response{body: body, status_code: 200} =
  MachineGun.post!(
    "https://httpbin.org/anything",
    "{\"hello\":\"world!\"}",
    [{"content-type", "application/json"}, {"accept", "application/json"}],
    %{pool_timeout: 1000, request_timeout: 5000, pool_group: :default})

Options are included to show defaults and can be omitted. pool_timeout and request_timeout default to values specified in pool group configuration. If not specified in pool group configuration they default to the values in the example.

Configuration

config :machine_gun,
  # Default pool group
  default: %{
    pool_size: 4,         # Poolboy size
    pool_max_overflow: 4, # Poolboy max_overflow
    pool_timeout: 1000,
    request_timeout: 5000,
    conn_opts: %{}        # Gun connection options
  }

Configuration example shows defaults and can be omitted. See Poolboy options documentation for explanation of pool_size and pool_max_overflow. See Gun manual for explanation of conn_opts.

Notes

  • When using MachineGun in a long-living process (for example genserver) make sure to handle messages in the form of {ref, _} tuples, which may be produced by pool timeouts.
  • When using MachineGun with HTTP/2 and modern HTTP/1 servers we recommend using lowercase header names. For example content-type.
  • MachineGun may timeout when request with empty body contains content-type header and does not contain content-length header. See this issue for details.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].