Events

ProxyServer ⇐ EventEmitter

Kind: global class
Extends: EventEmitter

“start”

Emitted when the hiproxy server(s) start.

Kind: event emitted by ProxyServer
Properties

Name Type Description
servers Array http/https server
localIP String the local ip address

“stop”

Emitted when the hiproxy server(s) stop.

Kind: event emitted by ProxyServer

“addHostsFile”

Emitted when add hosts file.

Kind: event emitted by ProxyServer
Properties

Name Type Description
filePath Array \ String rewrite file path(s)

“addRewriteFile”

Emitted when add rewrite file.

Kind: event emitted by ProxyServer
Properties

Name Type Description
filePath Array \ String rewrite file path(s)

“creatPacFile”

Emitter when the pac proxy file is created or updated.

Kind: event emitted by ProxyServer
Properties

Name Type Description
domains Object domain list

“httpsRequest”

Emitted each time there is a request to the https server.

Kind: event emitted by ProxyServer
Properties

Name Type Description
request http.IncomingMessage request object
response http.ServerResponse response object

“connect”

Emitted each time the server responds to a request with a CONNECT method.

Kind: event emitted by ProxyServer
Properties

Name Type Description
request http.IncomingMessage request object
socket net.Socket socket object
head Buffer head

“setResponse”

Emitted each time the server set response info (eg: headers).

Kind: event emitted by ProxyServer
Properties

Name Type Description
response http.ServerResponse request object

“request”

Emitted each time there is a request.

Kind: event emitted by ProxyServer
Properties

Name Type Description
request http.IncomingMessage request object
response http.ServerResponse response object

“getProxyInfo”

Emitted each time the hiproxy server get proxy info for current request.

Kind: event emitted by ProxyServer
Properties

Name Type Description
proxyInfo Object proxy info object

“setRequest”

Emitted each time the hiproxy server set request options (eg: headers and host) before request data from remote server

Kind: event emitted by ProxyServer
Properties

Name Type Description
request http.IncomingMessage request
proxyOptions Object the proxy header options

“setResponse”

Emitted each time the server set response info (eg: headers).

Kind: event emitted by ProxyServer
Properties

Name Type Description
response http.ServerResponse request object

“data”

Emitted whenever the response stream received some chunk of data.

Kind: event emitted by ProxyServer
Properties

Name Type Description
data Buffer response data

“response”

Emitted when a response is end. This event is emitted only once.

Kind: event emitted by ProxyServer
Properties

Name Type Description
response http.ServerResponse response object