-
Notifications
You must be signed in to change notification settings - Fork 15
ConfigurationHttpForward
Michael VERGOZ edited this page May 24, 2014
·
6 revisions
HTTP forward proxys are defined globaly in configuration as http sub-object:
Here is a base example:
var serverConfig = function(bs) { return({
serverProcess: 4,
hostname: "testServer0",
runDir: "/tmp/gatejs",
dataDir: "/path/to/dataDir",
logDir: "/var/log/gatejs",
http: {
generalInterface: {
type: 'forward',
port: 8080,
},
},
})};
gate.js HTTP engine can run multiple network instances in http object. Each instance has it owns name defined as a Javascript object key, which is generalInterface in our example.
Below are all options available for HTTP forwarding
http: {
generalInterface: {
type: 'forward',
isTproxy: false,
address: "0.0.0.0",
port: 8080,
method: 'host', /* will be moved to proxyPass opcode */
pipeline: 'forwardPipe',
/* SSL part */
ssl: true,
},
},
- type is the type of http interface, in our case you must define forward.
- isTproxy activates tproxy implementation (true or false) for the instance. Activating this options will make your http service replying with the destination address used by the user. It allows transprent L7 OSI interception. This option is actually only supported under Linux systems and needs iptables rules. Default is false (off)
- address is the service listening address, default 0.0.0.0
- port is the service port, default 80
- pipeline is the name of the pipeline associated. //We need to explain it//
In order to activate SSL on the interface you must set ssl to true.
SSL options are provided by node.js for more information please look at tls.createServer() function.
- ssl enable or disable SSL on instance. default false.
- pfx A string or Buffer containing the private key, certificate and CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with the key, cert and ca options.)
- key A string or Buffer containing the private key of the server in PEM format. (Required)
- passphrase A string of passphrase for the private key or pfx.
- cert A string or Buffer containing the certificate key of the server in PEM format. (Required)
- ca An array of strings or Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs will be used, like VeriSign. These are used to authorize connections.
- crl Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)
- ciphers A string describing the ciphers to use or exclude.
More options could be applied please read node.js manual for further.