Sign inSign up

dumbaspl/niji-proxy

By dumbaspl

Updated over 2 years ago

Proxy slitter server. Save data by only proxying the the domains that matter.

Image
Networking
0

1.7K

dumbaspl/niji-proxy repository overview

niji-proxy

Proxy slitter server. Save data by only proxying the the domains that matter.

Use case

You have a high quality proxy with limited bandwidth. The program using the proxy will try to proxy everything through it (images, scripts, cdn content, etc) but these requests don't actually need to be proxied since almost no CDN is doing any ip filtering. By using this project you can save bandwidth by only proxying the domains that matter (APIs, auth, etc).

Limitations

  • Only supports HTTP/HTTPS proxies
  • Only filtering by domain (no path filtering, most trafic is encrypted anyway)

Usage

Configuration

Configuration is done through environment variables. (.env file is supported)

VariableDescriptionDefaultRequired
LISTEN_HOSTHost to listen on0.0.0.0NO
LISTEN_PORTPort to listen on8080NO
GOOD_HOST_REGEXRegex to match good hosts-YES
GOOD_PROXYProxy to use for good hosts (matched by regex)-YES
BAD_PROXYProxy to use for bad hosts (not matched by regex)-NO
DEBUGEnable debug loggingfalseNO
NOTES

Caution

This proxy has not authentication of its own, do not expose it to the internet if you don't want to become an open proxy! It's designed to be used locally (localhost, docker network, etc)
  • if GOOD_PROXY has credentials, it will always use them and ignore the credentials from the client
  • if GOOD_PROXY has no credentials, it will passthrough the credentials from the client
  • if BAD_PROXY has no credentials, no authentication will be used (passthrough not supported to avoid leaking credentials)
  • if BAD_PROXY is missing, "bad" connections will be made directly to the target host (no proxy)
  • DEBUG will expose credentials in the logs, use with caution
Example
LISTEN_HOST=127.0.0.1
LISTEN_PORT=8080
GOOD_HOST_REGEX=^api\.
GOOD_PROXY=http://user:pass@good-proxy-server:8080
BAD_PROXY=http://bad-proxy-server:8080
Running
git clone https://github.com/dumbasPL/niji-proxy.git
cd niji-proxy
# Create .env file with the configuration

# Using docker
docker compose up

# Using node
npm install
npm start

License

MIT

Tag summary

Content type

Image

Digest

sha256:593785682

Size

45.2 MB

Last updated

over 2 years ago

docker pull dumbaspl/niji-proxy