Giter VIP home page Giter VIP logo

txn2 / n2proxy Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 8.0 439 KB

Contraband filtering reverse proxy for plain http and SSL.

Home Page: https://mk.imti.co/golang-reverse-proxy/

License: Apache License 2.0

Go 94.59% Dockerfile 1.80% Dockerfile 1.80% Dockerfile 1.80%
proxy http-server http-proxy http-proxy-middleware http-protocol-manipulation post xss-filter sql-injection-attacks sql-injection golang-application

n2proxy's Introduction

n2proxy

n2proxy

n2proxy is a reverse proxy for detecting and filtering suspicious data including xss, SQL injection or any matchable pattern in a URL or HTTP post body.

Install

# download sample configuration file
wget https://raw.githubusercontent.com/txn2/n2proxy/master/cfg.yml

# install on mac
brew install txn2/tap/n2proxy

# upgrade
brew upgrade n2proxy

Use

# get the version
n2proxy --version

# get help
n2proxy --help

# environment variable override defaults
CFG=./cfg.yml PORT=9090 BACKEND=http://example.com:80 n2proxy

# command line options override environment variables
n2proxy --port=9091 --backend=http://example.com:80


# docker
docker run --rm -t -v "$(pwd)":/cfg/ -p 9092:9092 \
    txn2/n2proxy --port=9092 --cfg=/cfg/cfg.yml \
    --backend=http://example.com

Browse to http://localhost:9090

Development Notes

This project uses Go Releaser.

Generate a build without publishing it:

goreleaser --skip-publish --rm-dist --skip-validate

Generate Release:

GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-dist

n2proxy's People

Contributors

cjimti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

n2proxy's Issues

[minor] use of deprecated default settings for goreleaser

When building the following messages are seen

$ goreleaser --skip-publish --rm-dist  --skip-validate

   • releasing using goreleaser 0.97.0...
   • loading config file       file=goreleaser.yml
   • RUNNING BEFORE HOOKS
   • GETTING AND VALIDATING GIT STATE
      • releasing v1.3.1, commit 0935d402b755efdae0d06595b9f183b84d5bbb63
      • skipped                   reason=validation is disabled
   • SETTING DEFAULTS
+         • DEPRECATED: `docker.image` should not be used anymore, check https://goreleaser.com/deprecations#docker-image for more info.
+         • DEPRECATED: `docker.tag_templates` should not be used anymore, check https://goreleaser.com/deprecations#docker-tag-templates for more info.
+         • DEPRECATED: `docker.binary` should not be used anymore, check https://goreleaser.com/deprecations#docker-binary for more info.
+         • DEPRECATED: `docker.image` should not be used anymore, check https://goreleaser.com/deprecations#docker-image for more info.
+         • DEPRECATED: `docker.tag_templates` should not be used anymore, check https://goreleaser.com/deprecations#docker-tag-templates for more info.
+         • DEPRECATED: `docker.binary` should not be used anymore, check https://goreleaser.com/deprecations#docker-binary for more info.
   • SNAPSHOTING
      • skipped                   reason=not a snapshot
   • CHECKING ./DIST
      • --rm-dist is set, cleaning it up
   • WRITING EFFECTIVE CONFIG FILE
      • writing                   config=dist/config.yaml
   • GENERATING CHANGELOG
      • writing                   changelog=dist/CHANGELOG.md
   • LOADING ENVIRONMENT VARIABLES
      • skipped                   reason=publishing is disabled
   • BUILDING BINARIES
      • building                  binary=dist/linux_amd64/n2proxy
      • building                  binary=dist/linux_arm_6/n2proxy
      • building                  binary=dist/darwin_amd64/n2proxy
   • ARCHIVES
      • creating                  archive=dist/n2proxy_macOS_amd64.tar.gz
      • creating                  archive=dist/n2proxy_linux_amd64.tar.gz
      • creating                  archive=dist/n2proxy_linux_arm.tar.gz
   • LINUX PACKAGES WITH NFPM
      • creating                  file=dist/n2proxy_amd64.deb package=n2proxy_amd64.deb
      • creating                  file=dist/n2proxy_amd64.rpm package=n2proxy_amd64.rpm
      • creating                  file=dist/n2proxy_armv6.rpm package=n2proxy_armv6.rpm
      • creating                  file=dist/n2proxy_armv6.deb package=n2proxy_armv6.deb
   • SNAPCRAFT PACKAGES
      • ignored unsupported arch  arch=armel
      • creating                  arch=amd64 snap=dist/n2proxy_amd64.snap
   • CALCULATING CHECKSUMS
      • checksumming              file=n2proxy_amd64.rpm
      • checksumming              file=n2proxy_macOS_amd64.tar.gz
      • checksumming              file=n2proxy_amd64.deb
      • checksumming              file=n2proxy_linux_arm.tar.gz
      • checksumming              file=n2proxy_linux_amd64.tar.gz
      • checksumming              file=n2proxy_armv6.rpm
      • checksumming              file=n2proxy_armv6.deb
   • SIGNING ARTIFACTS
      • skipped                   reason=artifact signing is disabled
   • DOCKER IMAGES
      • building docker image     image=txn2/n2proxy:armhf-1.3.1
      • building docker image     image=txn2/n2proxy:1.3.1
   • PUBLISHING
      • skipped                   reason=publishing is disabled
   • release succeeded after 6.65s

handling redirects

I am running n2proxy -backend http://localhost:8000 -port 5000

Hitting the / endpoint of that backend redirects (with a 301 or 302) to
http://localhost:8000/login. Unfortunately if I go to http://localhost:5000 I end up with
http://localhost:8000/login in my browser address bar. What I want is
http://localhost:5000/login. Do you know how to fix this?

Seems I need to intercept the Location header and rewrite it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.