Giter Site home page Giter Site logo

river's Introduction

Build Status

River

NOTE: River is a work in progress and should be considered extremely beta.

River is a general-purpose HTTP client with eventual hopes of full HTTP/2 support (along with support for HTTP/1.1). It is built from the ground up with three major goals:

  1. be fully compliant with RFC 7540
  2. be simple and straightforward to use, in the vein of HTTPoison
  3. be awesome, in the same way that Go's http library (which has built-in, transparent support for HTTP/2) is awesome.

Installation

  1. Add River to your list of dependencies in mix.exs:
def deps do
  [{:river, "~> 0.0.6"}]
end
  1. Ensure River is started before your application:
def application do
  [applications: [:river]]
end

Caveats

  1. Currently, River only knows how to make HTTP/2 requests to https:// endpoints. Soon, I'll add the ability to make a request via the Upgrade header so that requests to http:// endpoints will work as well.
  2. River doesn't currently speak HTTP/1.x. Once I finish up basic HTTP/2 support, HTTP1.x is next on the roadmap. The goal when using River in your project is that you should not need to know whether the underlying connection is using HTTP/2 or HTTP/1.x.
  3. River is as beta as it gets, and under active development with no promises of anything being backwards compatible ๐Ÿ˜ฌ (until we hit v1.0, of course)

Goals

  • Basic HTTP/2 support
  • HTTP/1 --> HTTP/2 upgrading
  • Full HTTP/2 support
  • Full HTTP/1.x support

Basic Usage

Simple GET

River.get("https://http2.golang.org/")
=> {:ok,
 %River.Response{__status: :ok,
  body: "<html>\n<body>\n<h1>Go...",
  closed: true, code: 200, content_type: "text/html; charset=utf-8",
  headers: headers: [{":status", "200"},
                     {"content-type", "text/html; charset=utf-8"},
                     {"content-length", "1708"},
                     {"date", "Fri, 30 Sep 2016 04:26:34 GMT"}]}}

Simple PUT

River.put("https://example.com/", "hello world")
=> {:ok, %River.Response{...}}

Request with timeout

# timeout unit is milliseconds
River.get("https://http2.golang.org/", timeout: 10)
=> {:error, :timeout}

river's People

Contributors

cjab avatar gmalkas avatar masonforest avatar peburrows avatar rslota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

river's Issues

proxy

If I understand correctly, the proxy is not supported at the moment? Is it planned to support a proxy?

Properly manage flow control

Currently, the flow control windows (incremented via WINDOW_UPDATE frames) are very naively managed, and we don't properly handle the separate connection and stream flow control windows. We should be much better about that.

Dynamic supervisor not found.

Howdy.

First up excited that someone has started working on this project. I am having a go at implementing a HTTP/2.0 server and want to use river for testing. unfortunetly I get this error.

== Compilation error on file lib/river/stream_supervisor.ex ==
** (CompileError) lib/river/stream_supervisor.ex:3: module Experimental.DynamicSupervisor is not loaded and could not be found
    (elixir) expanding macro: Kernel.use/1
    lib/river/stream_supervisor.ex:3: River.StreamSupervisor (module)
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

Am using elixir 1.4.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.