Git Product home page Git Product logo

proxycheck's Introduction

ProxyCheck

Proxy checker

DESCRIPTION

ProxyCheck show the response of a proxy script for URLs(s).

Proxy scripts are well described here: en.wikipedia.org/wiki/Proxy_auto-config

INSTALLATION

ProxyCheck is a Rails 7 application and all rails prerequisites applies.

Node.js, Yarn, Git and Ruby 3.0 or higher should be installed on the system.

Clone this repository and install gems:

git clone https://github.com/net1957/ProxyCheck.git
cd ProxyCheck
bundle install
yarn
bundle exec rails assets:precompile
bundle exec rails git_version
bundle exec rails rdoc

or with scripts (mainly for prod):

git clone https://github.com/net1957/ProxyCheck.git
./bin/setup  (or ./bin/update)

It should work on all nix systems, but not on windows due to the lack of support by the libv8-node gem used by mini_racer gem.

You can use Vagrant to test it. A Vagrantfile based on debian-10 and ruby 3.0 is provided.

CONFIGURATION

All Rails configuration apply, but no database is used, so activerecord is disabled. See config/application.rb file for details.

  1. You can use your own logo on the top of the page (optional).

    Simply put a png file (159*18 pixels) in app/assets/images directory and set the environment variable LOGO with the filename (without path).

    example:

    LOGO=mylogo.png
    
  2. you can hide the compress menu (optional).

    add the environment variable NO_COMPRESS_BUTTON (value does’nt matter)

    example:

    NO_COMPRESS_BUTTON=
  3. You can limit the proxy field to a list of selectable proxies (optional).

    add the environment variable PROXIES with the following format:

    label1;proxy1 url,label2;proxy2 url
    

    The proxy text box is changed to a select box

    example:

    PROXIES=normal proxy;http://proxy1.com/script.pac,special proxy;http://proxy2.com/script.pac

USAGE

Start the server

bin/rails server

Connect to your application with your URL (default to localhost:3000) and you have three input fields:

  • Script or script URL: you can select a proxy, put the source of your script or the URL of the script (the same as in your navigator). The server that host ProxyCheck must have access to the URL.

  • Client IPv4: the IP of your client. Default to the IP seen by the server.

  • URL(s): you can add one or many URL to check, one per line.

Hit the run button to see the results.

You can also compress your script by using the optimize menu entry and save the optimized file locally (if allowed).

CREDITS

This application is build on top of the proxy_pac_rb gem.

LICENSE


See license.txt file

proxycheck's People

Contributors

dependabot[bot] avatar net1957 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

maxmeyer

proxycheck's Issues

Feedback

@net1957 Thanks a lot for making this application available to the public! Sorry for the long time till I gave you feedback.

  1. Easy to use UI

    • I like your lean UI
    • What would help, would be some kind of authentication - at best with support for LDAP
  2. Compressing the Proxy.pac

    • Unfortunately does not work in my setup
    • Does it work both with files and pasted proxy.pac?
    • Disable the button for compression via ENV? (This might irritate supporters)
  3. Proxy.pac URLs

    • I've got a limited set of Proxy.pac-URLs
    • Would it be possible to have a dropdown list I can configure via ENV?
  4. Provide Docker Image

    Would you mind to provide a docker image?

Fixed set of URLs for Proxy.pac

Having an empty PC_PROXY_PAC_URLS would generate an empty input field. Having a predefined PC_PROXY_PAC_URLS variable should generate a drop down field.

Possible format for PC_PROXY_PAC_URLS

PC_PROXY_PAC_URLS=Desc1,http://example.com/proxy1.pac;Desc2,http://example.com/proxy2.pac

Add more metadata to output

Request

It would be helpful, if proxy check would output environment information - time, client ip. Additionally having the hostname resolved to it's ipv4 address would be very helpful.

Use case

Normally we would consider 10., 192. etc.-addresses to be "DIRECT" reachable, but in some cases we need to send non-local requests via a proxy server, e.g. there's a public domain www1.example.com mapped to a 10.-address.

Add docker image

Would you mind to add an Docker Image? Maybe something based on the given Dockerfile. This example uses the multistage build feature of docker which should be available on hub.docker.com since June 2017.

FROM ruby:2.4
MAINTAINER xxx

ENV RAILS_ENV=production

RUN apt-get update \
  && apt-get install -y libc-dev gcc g++ binutils build-essential

RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
  && apt-get install -y nodejs

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  && echo "deb http://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list \
  && apt-get update -y \
  && apt-get install -y yarn

ADD src/Gemfile* /tmp/app/
WORKDIR /tmp/app

RUN gem install bundler \
  && bundle install --without development test \
  && bundle update \
  && rm -r /tmp/app/

ADD src/ /srv/app/
ADD files/latest/config/*.rb /srv/app/config/initializers/
WORKDIR /srv/app/

RUN yarn install

RUN sed -i "s/:debug/:info/" config/environments/production.rb

RUN gem install bundler \
  && bundle install --without development test

RUN rake assets:precompile

ENTRYPOINT ["/usr/local/bundle/bin/rails"]
CMD ["server"]

######

FROM ruby:2.4
MAINTAINER xxx

ENV RAILS_ENV=production
ENV RAILS_LOG_TO_STDOUT=true

RUN apt-get update \
  && apt-get install -y nodejs

RUN rm -fr /usr/local/bundle/

COPY --from=0 /usr/local/bundle/ /usr/local/bundle/
COPY --from=0 /srv/app/ /srv/app/

WORKDIR /srv/app/

ENTRYPOINT ["/usr/local/bundle/bin/rails"]
CMD ["server"]

Asset pipeline fails

When starting the app, it fails with an JavaScript compilation error.

diff --git i/app/assets/javascripts/application.js w/app/assets/javascripts/application.js
index f7cca88..0bcc4ba 100644
--- i/app/assets/javascripts/application.js
+++ w/app/assets/javascripts/application.js
@@ -13,7 +13,6 @@
 //= require jquery
 //= require jquery_ujs
 //= require foundation
-//= require file-saver
 // require turbolinks
 //= require_tree .

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.