proxyfile

The HOCON form

The same gateway can be written in HOCON (Human-Optimized Config Object Notation, as the Lightbend specification defines it). Every key has the same name, meaning and rules as in the YAML form, and the generated file is the same, byte for byte.

A proxyfile's file name decides its form, never its content. A file named Proxyfile, with a capital P, or a name ending in .conf is HOCON, a name ending in .yaml or .yml is YAML, and any other name is refused.

# The smallest proxyfile, in HOCON: one service, one route, and the browser origins it admits.
listen = 8000
services {
  app { http = 3000 }
}
origins {
  all { hosts = [localhost], origins = ["http://localhost:3000"] }
}
routes = [
  { name = app, prefix = /, to = app }
]

Each example writes its HOCON form as hocon/Proxyfile, in a folder of its own beside yaml/, because render and check given no file refuse a folder that holds two of the names they read. examples/full/hocon/Proxyfile writes every key but rpc.proto, envoy.tracing, the xray provider, hash.client and the nginx and haproxy blocks (The format names the example that writes each), and gives the same file as examples/full/yaml/proxyfile.yaml. examples/tracing/hocon/Proxyfile writes tracing, as its YAML twin, examples/tracing/yaml/proxyfile.yaml, does, and examples/tracing/envoy-tracing/proxyfile.yaml writes the same at envoy.tracing and gives the same envoy.yaml. examples/grpc/hocon/Proxyfile turns envoy.connect_bridge off, as examples/grpc/yaml/proxyfile.yaml does. examples/partial/hocon/Proxyfile pulls its methods in with include required("../rpc-methods.conf"): a plain include is skipped when the file is missing, and required refuses it by name.

The rules of the form:

What a problem looks like:

Editors says how an editor and GitHub highlight a HOCON proxyfile.