Skip to content

ConfigurationHttpForward

Michael VERGOZ edited this page May 23, 2014 · 6 revisions

HTTP forward configuration

HTTP forward proxys are defined globaly in configuration as http sub-object:

Here is an 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 all options available for HTTP forwarding

http: {
	generalInterface: {
		type: 'forward',
		isTproxy: false,
		address: "0.0.0.0", 
		port: 8080, 
		method: 'host',
		pipeline: 'forwardPipe',
	},
},
  1. type is the type of http interface, in our case you must define forward.
  2. 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)
  3. address is the service listening address, default 0.0.0.0
  4. port is the service port, default 80
  5. method is the forwarding method uses request source servers :
  • host : use the request host HTTP header with IP DNS resolving in order to emit connections
  • tproxy-src-host spoof the source address and use the IP DNS resolving to emit connections
  • tproxy-src-dst spoof the source and use the destination address to emit connections
  • tproxy-dst do not spoof the source address but use the destination address to emit connections
  1. pipeline is the name of the pipeline associated. //We need to explain it//
Clone this wiki locally