HttpProxy.Handle

Handle every http request to outside of the server.

Summary

Functions

Callback implementation for c:Plug.call/2

Dispatch connection and Play/Record http/https requests

Callback implementation for c:Plug.init/1

Get proxy defined in config/config.exs

Get schemes which is defined as deault

Start Cowboy http process with localhost and arbitrary port. Clients access to local Cowboy process with HTTP potocol

Types

param :: binary | [param]
t :: %Plug.Conn{adapter: term, assigns: term, before_send: term, body_params: term, cookies: term, halted: term, host: term, method: term, owner: term, params: term, path_info: term, peer: term, port: term, private: term, query_params: term, query_string: term, remote_ip: term, req_cookies: term, req_headers: term, request_path: term, resp_body: term, resp_cookies: term, resp_headers: term, scheme: term, script_name: term, secret_key_base: term, state: term, status: term}

Functions

call(conn, opts)

Callback implementation for c:Plug.call/2.

dispatch(conn, opts)

Specs

dispatch(t, param) :: t

Dispatch connection and Play/Record http/https requests.

init(opts)

Callback implementation for c:Plug.init/1.

proxies()

Specs

proxies :: []

Get proxy defined in config/config.exs

Example

iex> HttpProxy.Handle.proxies
[%{port: 8080, to: "http://google.com"}, %{port: 8081, to: "http://neko.com"}]
schemes()

Specs

schemes :: []

Get schemes which is defined as deault.

Example

iex> HttpProxy.Handle.schemes
[:http, :https]
start_link(list)

Specs

start_link([binary]) :: pid

Start Cowboy http process with localhost and arbitrary port. Clients access to local Cowboy process with HTTP potocol.

uri(conn)

Specs

uri(t) :: String.t