0.1.16 • Published 11 years ago

port-vhoster v0.1.16

Weekly downloads
5
License
-
Repository
-
Last release
11 years ago

A dead simple HTTP vhost proxy routing / port sharing implementation for node.js

This project implements a dead simple HTTP multi domain name / IP / directory vhost port forwarding router proxy using the http-proxy module. It shows the power of node.js by being implemented in less than 50 lines of code.

Installing

    [sudo] npm install port-vhoster

Configuring

A valid configuration file for port-vhoster is written in JSON notation and contains 3 sections:

  • description = Description to log to the TTY
  • port = Source port to listen to. This is the port you want to enable port sharing for (e.g. 80)
  • vhosts = An object containing key ($ip OR $domain/port) and a value (target $ip:$port/$path)

Configuration example

The following configuration is a simple routing example. You can add more vhosts to the object and register more complex routings (domain name, ip, path) too:

    {
        "description": "For example routing all HTTP requests of port 8100 to localhost:8080...",
        "port": 8100,
        "vhosts": {
            "localhost": "127.0.0.1:8080"
        }
    }

By default you should save the config as plain text file called port-vhoster.json.

Running the port sharing proxy

Dead simple, just call node to run port-vhoster.js optionally name an alternative config file path:

    [sudo] node port-vhoster.js [alternative-config-file.json]

You will need super user permissions if you try the listen to (share) ports below 1024 (e.g. port 80).

0.1.16

11 years ago

0.1.15

11 years ago

0.1.14

11 years ago

0.1.13

11 years ago

0.1.12

11 years ago

0.1.11

11 years ago

0.1.10

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago