My shop has much love for HTML5 single page apps that call server-side JSON APIs.
We're pretty open minded about server stacks, so the API might run on a Ruby, .Net,
or Play! app server. This utility enables our front end UI devs to focus on writing
front-end HTML/CSS/JS goodness and not need to worry about how to provision/build/run
the app server on their local dev machine.

The forwarding rules for proxying support a number of different scenarios.

The forwarding rules use regular expressions in the spirit of nginx rewrite rules.

json-proxy will always preserve the request body (e.g., requests with
POST, PUT, or PATCH verbs). json-proxy will generally preserve
request headers, except in two situations. Custom headers in the config will
always clobber the existing value of the same header in the original request.
The proxy will also clobber headers typically used by proxy servers
(e.g., Via, X-Forwarded-For).

TIP: Reserved characters in Regex such as ? and
Regex character classes like \d (digits) and \s (whitespace) require escaping with a backslash
in forwaring rules (e.g. '\?', '\\d', '\\s').

You will need to use a regex capture group to delete fragments from the
requested URL. Use ()s to identify the fragments you want to keep in
the orignally requested URL. Use $1, $2, ... $9 in the target URL
to include the captured fragments.

var config ={

"forward":{

"/remote-api/(.*)":"https://api.example.com/$1"

}

};

This config would forward requests for /remote-api/* to
https://api.example.biz:443/*.

The proxy can optionally inject headers into proxied requests. This is useful
for remote endpoints that require headers values for authorization, like
API tokens. The value of the injected header may be either a string value
or a function that accepts the request object and returns a string value.

WebSockets are not implemented yet. WebSockets seem straightforward
to implement with the http-proxy module.
Please create an issue
if you need WebSocket support, along some details on your desired use case to
help spec the tests.