@prxi/dev
v0.1.4
Published
Localhost proxy server based on prxi
Maintainers
Readme
@prxi/dev
Local development proxy server. Mainly used to inject custom headers to both request and response.
Usage
Install globally:
npm i -g @prxi/devCreate .prxi.yml inside you project like the following:
# port to listen connections on
port: 4444
# upstream endpoint
upstream: http://localhost:8080Run prxi
CLI Options
-c --config [path]- optional path to the configuration file, default one.prxi.yml-o --option [name]- optional name for the options file
Custom Headers
Update .prxi.yml and add
default:
# additional request headers
request:
Authorization: Bearer 1
# addition response headers
response:
X-Custom-Header: valueOptions
It is possible to define different options for the request/response headers that will be added to the default set, add the following to the .prxi.yml:
options:
option-name:
# additional request headers
request:
Authorization: Bearer 2
# addition response headers
response:
X-Custom-Header: valueNote: in the example above both Authorization and X-Custom-Header values will override the ones used in the default section.
To apply the options run prxi cli with the -o --option parameter, e.g:
prxi -o option-nameUseful Links
- prxi zero dependency reverse proxy Node.js library
- fireblink/prxi-openid-connect an OpenID Connect reverse proxy server based on prxi
