An http-proxy that works in conjunction with trafficlight to block/enable certain endpoints.
  • TypeScript 99%
  • Dockerfile 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michael Kaye ee60512746
Merge pull request #11 from vector-im/michaelk/shutdown_proxy_on_exit
Ensure we shutdown a running proxy on exit() call.
2023-04-06 10:12:21 +01:00
.github/workflows Merge branch 'main' into michaelk/eslint 2022-10-13 17:48:40 +01:00
src Merge pull request #11 from vector-im/michaelk/shutdown_proxy_on_exit 2023-04-06 10:12:21 +01:00
.editorconfig Add editorconfig 2022-09-26 11:35:14 +05:30
.eslintrc.js Add linting configuration to project. 2022-10-13 17:37:34 +01:00
.gitignore Install nodemon and ts-node 2022-09-26 11:35:10 +05:30
Dockerfile A dockerfile for the network proxy. 2022-09-26 11:53:57 +01:00
LICENSE Initial commit 2022-09-26 11:25:39 +05:30
nodemon.json configure nodemon to clear terminal on start 2022-09-26 11:35:15 +05:30
package.json Missing ',' in merge of main. 2022-10-13 17:57:14 +01:00
README.md Allow LISTEN_PORT to be passed in environment variables to listen on specific port. 2023-03-20 15:28:05 +00:00
tsconfig.json Use target that allows for replaceAll 2022-09-26 11:35:16 +05:30
yarn.lock Add linting configuration to project. 2022-10-13 17:37:34 +01:00

Trafficlight Proxy Client

An http-proxy that registers as a trafficlight client which allows selective blocking of endpoints.

See this for more information.

Running


Install dependencies using:

yarn install

Run the client using:

yarn start

The proxy should now be available at http://localhost:4040

Development

Instead, run the client using:

yarn start-dev

The proxy will again be at http://localhost:4040, but nodemon will reload the proxy when changes are made.

Docker

There is a supported docker image at ghcr.io/vector-im/trafficlight-proxy can be used to run this proxy.

You must pass TRAFFICLIGHT_URL and PROXY_URL. You may also pass LISTEN_PORT.

TRAFFICLIGHT_URL should be set to a trafficlight server.

PROXY_URL should be set to an endpoint that the trafficlight clients can access.

LISTEN_PORT should be set to the tcp port that the proxy should bind to. If unset it will use the port from PROXY_URL.


The defaults are:

Change them via TRAFFICLIGHT_URL and PROXY_URL environment variables respectively.