Giter VIP home page Giter VIP logo

proxyserver's Introduction

A multi-threaded proxy server under 500 lines of Java code.

Features

  • HTTP only.
  • No keep-alive
  • Opens a new connection to the target server every time a client connection requests for it.
  • No caching.
  • Supports UTF-8 URLs (not tested)
  • Supports GET, POST and all other methods.
  • Supports HTTP video streaming, for e.g., youtube.
  • Supports logging of HTTP traffic from both client and server side.
  • Supports reading of chunked transfer encoding. In the log files, even though Transfer-Encoding might specify "chunked", the data logged would have been decoded for convenience.

Feel free to modify the code for your own use.

But please acknowledge the original author. Thanks!

Building using ANT

  1. Build https://github.com/lucastan/java-utils
  2. Make sure current directory is proxyServer
  3. Put java-utils-xxx.jar you built in step 1 into the proxyServer/lib dir (create it if necessary)
  4. Do git submodule init and git submodule update.
  5. Do ant.

Usage

Command: java -jar dist-1.0.0/proxy-1.0.0-all.jar [options]

options:
-t : Number of threads. Default is 3
-s : No logging. Default is to log
-n : Number of listen back log [Default=20]
-p : Listen port [Required]

Example : java -jar dist-1.0.0/proxy-1.0.0-all.jar -p 8080 -t 5

Log files will be created as proxy.{thread-id}.{client/serv}.log For e.g., proxy.0.client.log stores all traffic received from the client.

The headers shown in the log files are in unmodified form, and might not be the exact headers sent to the client/server.

proxyserver's People

Contributors

lucastan avatar

Watchers

 avatar

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.