This is a fork from kong-forward-proxy from @tfabien to support Kong 1.x
A Kong 1.x plugin that allows access to an upstream url through a forward proxy.
Add this plugin globally or attached to a Service. All calls routed to a Service will then be proxied through the specify proxy host and port.
$ curl -X POST http://kong:8001/service/{id}/plugins \
--data "name=forward-proxy" \
--data "config.proxy_host=proxy.mycorp.org" \
--data "config.proxy_port=8080"
Clone the repository, navigate to the root folder and run:
make install
Edit your kong.yaml
to include the plugin like so:
custom_plugins:
- forward-proxy
Or add it as an environment variable: KONG_PLUGINS=bundled,forward-proxy
Restart Kong.
A sample docker-compose is included for testing purpose. Running it will spin-up a Cassandra database and Kong instance with the plugin installed and activated.
Clone the repository, navigate to the root folder and run:
$ docker-compose up -d
Wait for the startup and migration of the database to complete and check plugin availability:
$ curl -X POST http://localhost:8001
{
"plugins": {
"enabled_in_cluster": [],
"available_on_server": {
// ...
"forward-proxy": true,
// ...
}
}
// ...
}
Untested behaviors include:
- HTTPS forward proxy
- Upstream load balancing