Attention

This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.

Proxy

The harp_apps.proxy application implements the core harp proxy features, and includes the configuration logic for endpoints.

Setup

The proxy application is loaded by default when using harp start ... or harp server ... commands.

Configuration

To configure proxy endpoints, you can use a yaml configuration file:

proxy:
  endpoints:
    - name: starwars
      port: 1234
      url: https://swapi.dev/

Proxy endpoints are the remote APIs that your proxy will serve. Each endpoint have a local port, a name, and a base URL.

Internal implementation: ProxySettings, ProxyEndpointSetting

Command line

It is also possible to add endpoints using the command line:

harp start --endpoint starwars=1234:https://swapi.dev/

You can use multiple --endpoint ... arguments and the option is available for all server-like commands (harp start ..., harp server ..., …).

Warning

For now, endpoints does not support subpaths on remote side. For exemple: http://example.com/ is supported as an endpoint base url but not http://example.com/foo/bar. Proxy will still forward requests to sub paths but no rewriting will be done on the request path.