chroxy v0.4.0 Chroxy.ProxyServer.Hook behaviour

Behaviour for Proxy Server Hooks. Example: Chroxy.ChromeProxy

Link to this section Summary

Callbacks

Optional callback which is invoked when either the upstream or downstream connections are closed. Useful for cleaning up resources which may have been linked to the lifetime of the proxy connection

Optional callback invoked when Chroxy.ProxyServer is initialised which allows for inteception and addition to the proxy_opts used by the proxy server. Useful for initialising downstream resources, and passing :downstream_host & :downstream_port for use by Chroxy.ProxyServer

Link to this section Callbacks

Link to this callback down(identifier, arg1) (optional)
down(identifier(), Map.t()) :: :ok

Optional callback which is invoked when either the upstream or downstream connections are closed. Useful for cleaning up resources which may have been linked to the lifetime of the proxy connection.

Link to this callback up(identifier, arg1) (optional)
up(identifier(), Keyword.t()) :: [
  downstream_host: charlist(),
  downstream_port: non_neg_integer()
]

Optional callback invoked when Chroxy.ProxyServer is initialised which allows for inteception and addition to the proxy_opts used by the proxy server. Useful for initialising downstream resources, and passing :downstream_host & :downstream_port for use by Chroxy.ProxyServer.