Sprites.Proxy.Session (Sprites v0.1.0)

View Source

Active proxy session managed by a GenServer.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the local address the proxy is listening on.

Stops a proxy session.

Types

t()

@type t() :: %Sprites.Proxy.Session{
  client: Sprites.Client.t(),
  listener: :gen_tcp.socket() | nil,
  local_port: non_neg_integer(),
  remote_host: String.t(),
  remote_port: non_neg_integer(),
  sprite_name: String.t()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

local_addr(pid)

@spec local_addr(pid()) ::
  {:ok, :inet.socket_address(), :inet.port_number()} | {:error, term()}

Gets the local address the proxy is listening on.

start_link(client, sprite_name, mapping)

Starts a proxy session.

stop(pid)

@spec stop(pid()) :: :ok

Stops a proxy session.