Class: BaseProxy

BaseProxy


<abstract> new BaseProxy( [opts])

Base proxy.

Parameters:
Name Type Argument Description
opts object <optional>

Options.

Properties
Name Type Argument Default Description
speed number <optional>
<nullable>
null

Proxy speed, kb/s.

reqSpeed number <optional>
<nullable>
null

Requests speed, kb/s.

resSpeed number <optional>
<nullable>
null

Responses speed, kb/s.

useCache boolean <optional>
false

Flag to use cache middleware.

reconnect number <optional>
0

Number of times reconnect to remote side, if it breaks connection.

timeout timeout <optional>
60000

Time to wait remote side response, ms.

port port <optional>
0

Port. Default is random.

Source:

Methods


getPort()

Gets port number.

Source:
Throws:

If port number is not defined and will be chosen randomly.

Type
Error
Returns:

Proxy port number.

Type
number

getResponsesData()

Gets responses data.

Source:

measureResponses()

Starts to measure responses and gather information of them.

Source:

resetSpeed()

Resets proxy speed.

Source:

setSpeed(speed)

Sets proxy speed.

Parameters:
Name Type Description
speed number | object

Proxy speed, kb/s.

Properties
Name Type Argument Description
req number <optional>
<nullable>

Requests speed, kb/s.

res number <optional>
<nullable>

Responses speed, kb/s.

Source:

start()

Starts proxy.

Source:

stop()

Stops proxy server.

Source:

unmeasureResponses()

Disables responses measurement.

Source: