Proxy Server

Proxy Server

Released 7 years ago , Last update 7 years ago

A HTTP Proxy Server with customizable request handlers running over NodeJs.

Features

 

5.0
  • 5 1
  • 4 0
  • 3 0
  • 2 0
  • 1 0
1 Reviews Read Reviews

Pricing

FREE

Developer License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use

Installation

To Run the server you need to install nodejs first:

Just go to http://nodejs.org/ and download the latest version. Then go to https://github.com/joyent/node/wiki/Installation and follow the instructions to install node.

After this, you can unpack the Proxy Server zip file and run it on a terminal. Open a new terminal, navigate to the proxy server directory and type:

~$ node proxy.js

Now the server is running on localhost:8000.


It's time to setup your browser to listen it. Do the follow (On Mozila FireFox):

  • Go to Edit > Preferences on the menu bar
  • In the tab "Advanced" Select "Network" and click on "Settings"
  • Select the option "Manual proxy configuration"
  • In the textbox HTTP Proxy write: localhost and set the port to 8000.
  • Click on Ok and it's done! You're Ready to Browse.

Customized Request Handlers

You can extend your server adding request handlers in the handlers.js file.

A handler must be an object that contains a 'pattern' (string which matches the urls) and an 'action' (function that indicates what to do with the request). For example:

var handler = {
    pattern : 'facebook',
    action : function(response) {
        response.writeHead(200, {'Content-Type': 'text/html'});
        response.end("Hello facebook!");   
    }
}

The handler must be in a list of handlers that are exported to the server module:

 exports.handlers = [handler];

That's all! If you want to write more complex modules, you can read the node js documentation (http://nodejs.org/docs/v0.4.3/api/http.html) or contact me.

Enjoy the code!

License » Developer License Download

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
No comments have been posted yet.