curl https://dio.github.io/proxy/install.sh | bash -s -- -b /usr/local/binNote: By default the script installs (if executed without
-- -b /usr/local/bin) in the current directory:./bin/proxy.
To generate a proxy config with specified admin and stats ports:
proxy --admin-port 9000 --stats-port 9001 --output a.yamlThen you can run proxy with that config:
proxy -- -c ./a.yamlproxy comes with its own xDS server implementation that watches a directory with proxy configs in
it. As an example, see: testdata/hello.
proxy --xds-resources testdata/hello --admin-port 9000Note: you can start with a non-existent directory as argument for
--xds-resources.
This starts proxy with configurations defined in testdata/hello/*.yaml. Note that it watches
changes inside that directory. For example, if you change the listener address for listener_0 in
testdata/hello/a.yaml, e.g. from 10000 to 10001 it will immediately
reflected (this can be checked by visiting the admin interface, in this example:
https://localhost:9000)
You can test it out:
curl localhost:10000
curl localhost:10001If you have a running xDS server already, you can connect to that and set your proxy's Node ID:
# localhost:9901 is the default value for `xds-server-url`.
proxy --node-id my-proxyproxy --node-id my-proxy --xds-server-url localhost:9902Note: TLS configuration (and other channel and call credentials) will be added in the next release.
proxy is a Go project, hence can be installed using:
go install github.com/dio/proxy@latestAlso, you can go run it directly:
go run github.com/dio/proxy@latest --helpYou can download standalone xds-server starts from v0.0.1-rc2.
xds-server --resources testdata/helloUsing Go, you can do:
go run github.com/dio/proxy/xds-server@latest --helpSee internal/proxy for a sample usage of the public APIs
(config, handler, and runner).
See: LICENSE.