@codeurs/n-proxy

0.0.2 • Public • Published

n-proxy

Proxy all http requests to another process.

Node server example

<?php
require './node_modules/@codeurs/n-proxy/proxy.php';
forward(
  // Server will be started if not running
  'node server.js',
  // Port on which the server will listen
  3000,
  // A version string which triggers a restart if changed since last run
  (string) filemtime('server.js')
);

If running under apache, you can rewrite all requests to this file:

RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [QSA,L]

Dependencies (0)

    Dev Dependencies (11)

    Package Sidebar

    Install

    npm i @codeurs/n-proxy

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    8.32 kB

    Total Files

    3

    Last publish

    Collaborators

    • dmerckx
    • benmerckx
    • stijnvd_26
    • cloetensbrecht