From 5d9c9a3edc3d2aaa7e47e38e6ca638f3158eab7b Mon Sep 17 00:00:00 2001 From: Ben Rometsch Date: Tue, 21 Nov 2023 10:56:25 +0000 Subject: [PATCH 1/3] better readme --- CONTRIBUTING.md | 60 +++++++++++++++++++++++++++++++++++++++++++++ readme.md | 65 +++++++++++-------------------------------------- 2 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ec89b7a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,60 @@ +# Flagsmith Edge Proxy + +https://docs.flagsmith.com/advanced-use/edge-proxy + +## Configuration + +Edge proxy can be configured using the `config.json` file located at the root. + +### Supported configuration + +You can set the following configuration(in config.json) to control the behaviour +of edge-proxy + +- environment_key_pairs: An array of environment key pair objects, e.g: + `"environment_key_pairs":[{"server_side_key":"your_server_side_key", "client_side_key":"your_client_side_environment_key"}]` + +- [Optional]api_poll_frequency(seconds): it is used to control how often the proxy is going to ping the server for changes, + e.g: `"api_poll_frequency":10` + +- [Optional]api_url: If you are running a self hosted version of flagsmith you can add the self hosted url here for edge-proxy to ping + your server, e.g: `"api_url":"https://self.hosted.flagsmith.com/api/v1"` + +### Here are some examples of adding local `config.json` to edge-proxy: + +- With docker run: + `docker run -v //config.json:/app/config.json flagsmith/edge-proxy:latest` + +- With docker compose: + +```yaml +version: "3.9" +services: + edge_proxy: + image: flagsmith/edge-proxy:latest + volumes: + - type: bind + source: //config.json + target: /app/config.json +``` + +## Load Testing + +You can send post request with `wrk` like this: + +```bash +cd load-test +wrk -t10 -c40 -d5 -s post.lua -H 'X-Environment-Key: NC7zfaBWg7QJhbHpUMs7tv' 'http://localhost:8001/api/v1/identities/?identifier=development_user_123456' +``` + +# Realtime(SSE) + +## Development + +### Requirement: +* Redis: In order to run the test please make sure environment variables `REDIS_HOST`(default: localhost) and `REDIS_PORT`(default:6379) are set correctly + + + + + diff --git a/readme.md b/readme.md index ec89b7a..cc23921 100644 --- a/readme.md +++ b/readme.md @@ -1,60 +1,23 @@ -# Flagsmith Edge Proxy +[![Feature Flag, Remote Config and A/B Testing platform, Flagsmith](https://raw.githubusercontent.com/Flagsmith/flagsmith/main/static-files/hero.png)](https://www.flagsmith.com/) -https://docs.flagsmith.com/advanced-use/edge-proxy +[![Join the Discord chat](https://img.shields.io/discord/517647859495993347)](https://discord.gg/hFhxNtXzgm) -## Configuration +[Flagsmith](https://flagsmith.com/) is an open source, fully featured, Feature Flag and Remote Config service. Use our +hosted API, deploy to your own private cloud, or run on-premise. -Edge proxy can be configured using the `config.json` file located at the root. +# Edge Proxy -### Supported configuration - -You can set the following configuration(in config.json) to control the behaviour -of edge-proxy - -- environment_key_pairs: An array of environment key pair objects, e.g: - `"environment_key_pairs":[{"server_side_key":"your_server_side_key", "client_side_key":"your_client_side_environment_key"}]` - -- [Optional]api_poll_frequency(seconds): it is used to control how often the proxy is going to ping the server for changes, - e.g: `"api_poll_frequency":10` - -- [Optional]api_url: If you are running a self hosted version of flagsmith you can add the self hosted url here for edge-proxy to ping - your server, e.g: `"api_url":"https://self.hosted.flagsmith.com/api/v1"` - -### Here are some examples of adding local `config.json` to edge-proxy: - -- With docker run: - `docker run -v //config.json:/app/config.json flagsmith/edge-proxy:latest` - -- With docker compose: - -```yaml -version: "3.9" -services: - edge_proxy: - image: flagsmith/edge-proxy:latest - volumes: - - type: bind - source: //config.json - target: /app/config.json -``` - -## Load Testing - -You can send post request with `wrk` like this: - -```bash -cd load-test -wrk -t10 -c40 -d5 -s post.lua -H 'X-Environment-Key: NC7zfaBWg7QJhbHpUMs7tv' 'http://localhost:8001/api/v1/identities/?identifier=development_user_123456' -``` - -# Realtime(SSE) - -## Development - -### Requirement: -* Redis: In order to run the test please make sure environment variables `REDIS_HOST`(default: localhost) and `REDIS_PORT`(default:6379) are set correctly +The Flagsmith Edge Proxy allows you to run an instance of the Flagsmith Engine close to your servers. If you are running +Flagsmith within a server-side environment and you want to have very low latency flags, you have two options: +1. Run the Edge Proxy and connect to it from your server-side SDKs +2. Run your server-side SDKs in [Local Evaluation Mode](/clients/overview#2---local-evaluation). +The main benefit to running the Edge Proxy is that you reduce your polling requests against the Flagsmith API itself. +The main benefit to running server side SDKs in [Local Evaluation Mode](/clients/overview#2---local-evaluation) is that +you get the lowest possible latency. +## Useful Links +[Documentation](https://docs.flagsmith.com/advanced-use/edge-proxy) From 92a4d64f0dc9a71439972f3e1bf6b80b7a86fd38 Mon Sep 17 00:00:00 2001 From: Ben Rometsch Date: Tue, 21 Nov 2023 10:56:47 +0000 Subject: [PATCH 2/3] docs/update readme --- readme.md => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename readme.md => README.md (100%) diff --git a/readme.md b/README.md similarity index 100% rename from readme.md rename to README.md From 9bb3393614979ca746c27790f342499a0d171535 Mon Sep 17 00:00:00 2001 From: Ben Rometsch Date: Tue, 21 Nov 2023 10:58:04 +0000 Subject: [PATCH 3/3] docs/update readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc23921..c419f00 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,11 @@ The Flagsmith Edge Proxy allows you to run an instance of the Flagsmith Engine c Flagsmith within a server-side environment and you want to have very low latency flags, you have two options: 1. Run the Edge Proxy and connect to it from your server-side SDKs -2. Run your server-side SDKs in [Local Evaluation Mode](/clients/overview#2---local-evaluation). +2. Run your server-side SDKs in [Local Evaluation Mode](https://docs.flagsmith.com/clients/overview#2---local-evaluation). The main benefit to running the Edge Proxy is that you reduce your polling requests against the Flagsmith API itself. -The main benefit to running server side SDKs in [Local Evaluation Mode](/clients/overview#2---local-evaluation) is that -you get the lowest possible latency. +The main benefit to running server side SDKs in [Local Evaluation Mode](https://docs.flagsmith.com/clients/overview#2---local-evaluation) is that you get the lowest possible latency. ## Useful Links