bulb/commands~ ControlCommand

new ControlCommand(commandStr)

Wraps a control command to send over the control port.

Parameters:
NameTypeDescription
commandStrstring

Command to send.

Members

cmd

Properties
NameTypeDescription
cmdstring

Command instance was intialized with.

Methods

toString() → {string}

Unwraps the command as a raw string.

Returns:
Type: 
string

(static) ADD_ONION(ports, addOnionOptsopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
portsstring | Array.<number> | number

Ports to map this onion service to.

addOnionOptsmodule:bulb/commands~ControlCommand~AddOnionOptions<optional>

Configuration options.

(static) ATTACHSTREAM(streamId, options) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
streamIdstring

Stream ID to attach to circuit.

optionsmodule:bulb/commands~ControlCommand~AttachStreamOptions

(static) AUTHCHALLENGE(nonceopt, typeopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDefaultDescription
noncestring<optional>
""

Client nonce for challenge.

typestring<optional>
"SAFECOOKIE"

The type of challenge.

(static) AUTHENTICATE(tokenopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDefaultDescription
tokenstring<optional>
""

The auth token to send.

(static) CLOSECIRCUIT(circuitId, optionsopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
circuitIdstring

Circuit ID to close.

optionsobject<optional>
Properties
NameTypeAttributesDefaultDescription
ifUnusedboolean<optional>
false

Only close if circuit is unused.

(static) CLOSESTREAM(streamId, reasonopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDefaultDescription
streamIdstring

Stream ID to close.

reasonnumber<optional>
1

Reason code for closing.

(static) DEL_ONION(serviceId) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
serviceIdstring

Onion address excluding ".onion".

(static) DROPGUARDS() → {module:bulb/commands~ControlCommand}

(static) EXTENDCIRCUIT(circuitId, purposeopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
circuitIdstring

Circuit ID to extend.

purposestring<optional>

Purpose to set for the circuit.

(static) GETCONF(keyword) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
keywordstring

Configuration key to get.

(static) GETINFO(keyword) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
keywordstring

Keyword for info to get.

(static) HSFETCH(serviceId, serverLongNameopt) → {string}

Parameters:
NameTypeAttributesDescription
serviceIdstring

Hidden service onion URL without ".onion".

serverLongNamestring<optional>

Server name to fetch from.

Returns:
Type: 
string

(static) HSPOST(descriptor, serverLongNameopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
descriptorstring

Raw hidden service descriptor string.

serverLongNamestring<optional>

Server name to post to.

(static) LOADCONF(configText) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
configTextstring

Sends the torrc configuration to the controller.

(static) MAPADDRESS(targetAddr, replaceAddr) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
targetAddrstring

Address to map from.

replaceAddrstring

Address to map to.

(static) POSTDESCRIPTOR(descriptor, options) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
descriptorObject.<string, string>

Key value pairs for descriptor to post.

optionsmodule:bulb/commands~ControlCommand~PostDescriptorOptions

(static) PROTOCOLINFO() → {module:bulb/commands~ControlCommand}

(static) QUIT() → {module:bulb/commands~ControlCommand}

(static) REDIRECTSTREAM(streamId, address, portopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
streamIdstring

Stream ID to redirect.

addressstring

Hostname to redirect to.

portnumber<optional>

Port to redirect to.

(static) RESETCONF(keyword) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
keywordstring

Configuration key to reset.

(static) RESOLVE(address, reverseopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDefaultDescription
addressstring

Address to resolve.

reverseboolean<optional>
false

Do reverse lookup.

(static) SAVECONF() → {module:bulb/commands~ControlCommand}

(static) SETCIRCUITPURPOSE(circuitId, purposeopt) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeAttributesDescription
circuitIdstring

Circuit ID to set purpose for.

purposestring<optional>

Purpose to set for the circuit.

(static) SETCONF(keyword, value) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
keywordstring

Configuration key.

valuestring

Configuration value.

(static) SETEVENTS(events) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
eventsArray.<string>

Names of events that tor should send.

(static) SIGNAL(signal) → {module:bulb/commands~ControlCommand}

Parameters:
NameTypeDescription
signalstring

module:bulb/commands~ControlCommand~Signal type to send.

(static) TAKEOWNERSHIP() → {module:bulb/commands~ControlCommand}

Type Definitions

AddOnionOptions

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
clientNamestring<optional>

Client auth identifier.

clientBlobstring<optional>

Arbitrary auth data.

keyTypestring<optional>
"NEW"

Create a new key or use RSA1024.

keyBlobstring<optional>
"BEST"

Key type to create or serialized.

discardPrivateKeyboolean<optional>
false

Do not return key.

detachboolean<optional>
false

Keep service running after close.

basicAuthboolean<optional>
false

Use client name and blob auth.

nonAnonymousboolean<optional>
false

Non-anononymous mode.

virtualPortnumber<optional>
80

Virtual port to expose on the hidden service.

AttachStreamOptions

Type:
  • object
Properties
NameTypeAttributesDescription
circuitIdstring

Circuit ID to attach stream to.

hopNumberstring<optional>

Hop number in circuit to attach stream to.

PostDescriptorOptions

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
options.purposestring<optional>
"general"

Set descriptor purpose.

options.cacheboolean<optional>
true

Cache the descriptor.

Signal

Map of control signals.

Type:
  • Object.<string, string>