proxy-kit

0.0.5 • Public • Published

Overview

Why another proxy tool?

Nginx's if condition syntax sucks, and I need more flexibility. Writing coffeescript is much much better than learning another javascript like config-language with no debugging break point.

Performance

I think this may be true Apache < proxy-kit < nginx. So it may won't be a bad idea to use it behind a nginx server.

Install

npm install proxy-kit

Quick Start

Reverse Proxy

Proxy_kit = require 'proxy-kit'
 
proxy_kit = new Proxy_kit { port: 80 }
 
proxy_kit.add Proxy_kit.reverse_proxy(
    'http://one.ysmood.org:8013'
)

Prefix Proxy

Under the main namespace there's a predefined function prefix_proxy, we use it for demo.

Proxy_kit = require 'proxy-kit'
 
proxy_kit = new Proxy_kit { port: 80 }
 
proxy_kit.add Proxy_kit.prefix_proxy(
    'http://one.ysmood.org:8013'
    '/prefix'
)

Then when client visit http://one.ysmood.org/prefix/index?q=10, the server behind the proxy will get http://one.ysmood.org:8013/index?q=10 without the word prefix.

Useful when you only have one subdomain name, and want to bind it to multiple servers.

Road Map

  • Add more handy functions to the kit.

  • Error handling.

Readme

Keywords

none

Package Sidebar

Install

npm i proxy-kit

Weekly Downloads

5

Version

0.0.5

License

none

Last publish

Collaborators

  • ysmood