TorProcess.html 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TorProcess - Documentation</title>
  6. <script src="scripts/prettify/prettify.js"></script>
  7. <script src="scripts/prettify/lang-css.js"></script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  14. </head>
  15. <body>
  16. <input type="checkbox" id="nav-trigger" class="nav-trigger" />
  17. <label for="nav-trigger" class="navicon-button x">
  18. <div class="navicon"></div>
  19. </label>
  20. <label for="nav-trigger" class="overlay"></label>
  21. <nav>
  22. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ControlServer.html">ControlServer</a><ul class='methods'><li data-type='method'><a href="ControlServer.html#.instance_info">instance_info</a></li><li data-type='method'><a href="ControlServer.html#close">close</a></li><li data-type='method'><a href="ControlServer.html#createDNSServer">createDNSServer</a></li><li data-type='method'><a href="ControlServer.html#createHTTPServer">createHTTPServer</a></li><li data-type='method'><a href="ControlServer.html#createSOCKSServer">createSOCKSServer</a></li><li data-type='method'><a href="ControlServer.html#createTorPool">createTorPool</a></li><li data-type='method'><a href="ControlServer.html#listen">listen</a></li><li data-type='method'><a href="ControlServer.html#listenTcp">listenTcp</a></li><li data-type='method'><a href="ControlServer.html#listenWs">listenWs</a></li></ul></li><li><a href="DNSServer.html">DNSServer</a><ul class='methods'><li data-type='method'><a href="DNSServer.html#listen">listen</a></li></ul></li><li><a href="HTTPServer.html">HTTPServer</a><ul class='methods'><li data-type='method'><a href="HTTPServer.html#listen">listen</a></li></ul></li><li><a href="SOCKSServer.html">SOCKSServer</a><ul class='methods'><li data-type='method'><a href="SOCKSServer.html#listen">listen</a></li></ul></li><li><a href="TorPool.html">TorPool</a><ul class='methods'><li data-type='method'><a href="TorPool.html#add">add</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group">add_instance_to_group</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group_at">add_instance_to_group_at</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group_by_name">add_instance_to_group_by_name</a></li><li data-type='method'><a href="TorPool.html#create">create</a></li><li data-type='method'><a href="TorPool.html#create_instance">create_instance</a></li><li data-type='method'><a href="TorPool.html#exit">exit</a></li><li data-type='method'><a href="TorPool.html#get_config_at">get_config_at</a></li><li data-type='method'><a href="TorPool.html#get_config_by_name">get_config_by_name</a></li><li data-type='method'><a href="TorPool.html#instance_at">instance_at</a></li><li data-type='method'><a href="TorPool.html#instance_by_name">instance_by_name</a></li><li data-type='method'><a href="TorPool.html#instances_by_group">instances_by_group</a></li><li data-type='method'><a href="TorPool.html#new_identites">new_identites</a></li><li data-type='method'><a href="TorPool.html#new_identites_by_group">new_identites_by_group</a></li><li data-type='method'><a href="TorPool.html#new_identity_at">new_identity_at</a></li><li data-type='method'><a href="TorPool.html#new_identity_by_name">new_identity_by_name</a></li><li data-type='method'><a href="TorPool.html#next">next</a></li><li data-type='method'><a href="TorPool.html#next_by_group">next_by_group</a></li><li data-type='method'><a href="TorPool.html#remove">remove</a></li><li data-type='method'><a href="TorPool.html#remove_at">remove_at</a></li><li data-type='method'><a href="TorPool.html#remove_by_name">remove_by_name</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group">remove_instance_from_group</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group_at">remove_instance_from_group_at</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group_by_name">remove_instance_from_group_by_name</a></li><li data-type='method'><a href="TorPool.html#set_config_all">set_config_all</a></li><li data-type='method'><a href="TorPool.html#set_config_at">set_config_at</a></li><li data-type='method'><a href="TorPool.html#set_config_by_group">set_config_by_group</a></li><li data-type='method'><a href="TorPool.html#set_config_by_name">set_config_by_name</a></li><li data-type='method'><a href="TorPool.html#signal_all">signal_all</a></li><li data-type='method'><a href="TorPool.html#signal_at">signal_at</a></li><li data-type='method'><a href="TorPool.html#signal_by_group">signal_by_group</a></li><li data-type='method'><a href="TorPool.html#signal_by_name">signal_by_name</a></li></ul></li><li><a href="TorProcess.html">TorProcess</a><ul class='methods'><li data-type='method'><a href="TorProcess.html#create">create</a></li><li data-type='method'><a href="TorProcess.html#exit">exit</a></li><li data-type='method'><a href="TorProcess.html#get_config">get_config</a></li><li data-type='method'><a href="TorProcess.html#new_identity">new_identity</a></li><li data-type='method'><a href="TorProcess.html#set_config">set_config</a></li><li data-type='method'><a href="TorProcess.html#signal">signal</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-tor-router.html">tor-router</a></li><li><a href="module-tor-router_ControlServer.html">tor-router/ControlServer</a></li><li><a href="module-tor-router_default_config.html">tor-router/default_config</a></li><li><a href="module-tor-router_default_ports.html">tor-router/default_ports</a></li><li><a href="module-tor-router_DNSServer.html">tor-router/DNSServer</a></li><li><a href="module-tor-router_HTTPServer.html">tor-router/HTTPServer</a></li><li><a href="module-tor-router_launch.html">tor-router/launch</a></li><li><a href="module-tor-router_nconf_load_env.html">tor-router/nconf_load_env</a></li><li><a href="module-tor-router_SOCKSServer.html">tor-router/SOCKSServer</a></li><li><a href="module-tor-router_TorPool.html">tor-router/TorPool</a></li><li><a href="module-tor-router_TorProcess.html">tor-router/TorProcess</a></li><li><a href="module-tor-router_winston_silent_logger.html">tor-router/winston_silent_logger</a></li></ul><h3>Events</h3><ul><li><a href="DNSServer.html#event:instance-connection">instance-connection</a></li><li><a href="HTTPServer.html#event:instance-connection">instance-connection</a></li><li><a href="SOCKSServer.html#event:instance-connection">instance-connection</a></li><li><a href="TorPool.html#event:instance_created">instance_created</a></li><li><a href="TorProcess.html#event:control_listen">control_listen</a></li><li><a href="TorProcess.html#event:controller_ready">controller_ready</a></li><li><a href="TorProcess.html#event:dns_listen">dns_listen</a></li><li><a href="TorProcess.html#event:error">error</a></li><li><a href="TorProcess.html#event:process_exit">process_exit</a></li><li><a href="TorProcess.html#event:ready">ready</a></li><li><a href="TorProcess.html#event:socks_listen">socks_listen</a></li></ul><h3>Global</h3><ul><li><a href="global.html#assembleHost">assembleHost</a></li><li><a href="global.html#cleanUp">cleanUp</a></li><li><a href="global.html#env_whitelist">env_whitelist</a></li><li><a href="global.html#logger">logger</a></li><li><a href="global.html#main">main</a></li><li><a href="global.html#nconf">nconf</a></li><li><a href="global.html#REALM">REALM</a></li><li><a href="global.html#setup_nconf_env">setup_nconf_env</a></li><li><a href="global.html#TOR_ROUTER_PROXY_AGENT">TOR_ROUTER_PROXY_AGENT</a></li></ul>
  23. </nav>
  24. <div id="main">
  25. <h1 class="page-title">TorProcess</h1>
  26. <section>
  27. <header>
  28. <h2>
  29. TorProcess
  30. </h2>
  31. <div class="class-description">Class that represents an individual Tor process.</div>
  32. </header>
  33. <article>
  34. <div class="container-overview">
  35. <h2>Constructor</h2>
  36. <h4 class="name" id="TorProcess"><span class="type-signature"></span>new TorProcess<span class="signature">(tor_path, definition<span class="signature-attributes">opt</span>, granax_options<span class="signature-attributes">opt</span>, logger<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
  37. <dl class="details">
  38. <dt class="tag-source">Source:</dt>
  39. <dd class="tag-source"><ul class="dummy"><li>
  40. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line37">line 37</a>
  41. </li></ul></dd>
  42. </dl>
  43. <div class="description">
  44. Creates an instance of `TorProcess`
  45. </div>
  46. <h5>Parameters:</h5>
  47. <table class="params">
  48. <thead>
  49. <tr>
  50. <th>Name</th>
  51. <th>Type</th>
  52. <th>Attributes</th>
  53. <th class="last">Description</th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. <tr>
  58. <td class="name"><code>tor_path</code></td>
  59. <td class="type">
  60. <span class="param-type">string</span>
  61. </td>
  62. <td class="attributes">
  63. </td>
  64. <td class="description last">Path to the Tor executable.</td>
  65. </tr>
  66. <tr>
  67. <td class="name"><code>definition</code></td>
  68. <td class="type">
  69. <span class="param-type"><a href="global.html#InstanceDefinition">InstanceDefinition</a></span>
  70. </td>
  71. <td class="attributes">
  72. &lt;optional><br>
  73. </td>
  74. <td class="description last">Object containing various options for the instance. See <a href="global.html#InstanceDefinition">InstanceDefinition</a> for more info.</td>
  75. </tr>
  76. <tr>
  77. <td class="name"><code>granax_options</code></td>
  78. <td class="type">
  79. <span class="param-type">Object</span>
  80. </td>
  81. <td class="attributes">
  82. &lt;optional><br>
  83. </td>
  84. <td class="description last">Object containing options that will be passed to granax.</td>
  85. </tr>
  86. <tr>
  87. <td class="name"><code>logger</code></td>
  88. <td class="type">
  89. <span class="param-type">Logger</span>
  90. </td>
  91. <td class="attributes">
  92. &lt;optional><br>
  93. </td>
  94. <td class="description last">A winston logger. If not provided no logging will occur.</td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. </div>
  99. <h3 class="subsection-title">Extends</h3>
  100. <ul>
  101. <li>EventEmitter</li>
  102. </ul>
  103. <h3 class="subsection-title">Members</h3>
  104. <h4 class="name" id="control_password"><span class="type-signature"></span>control_password<span class="type-signature"> :string</span></h4>
  105. <dl class="details">
  106. <dt class="tag-source">Source:</dt>
  107. <dd class="tag-source"><ul class="dummy"><li>
  108. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line78">line 78</a>
  109. </li></ul></dd>
  110. </dl>
  111. <div class="description">
  112. The password that will be set for the control protocol.
  113. </div>
  114. <h5>Type:</h5>
  115. <ul>
  116. <li>
  117. <span class="param-type">string</span>
  118. </li>
  119. </ul>
  120. <h4 class="name" id="control_port"><span class="type-signature">(readonly) </span>control_port<span class="type-signature"> :number</span></h4>
  121. <dl class="details">
  122. <dt class="tag-source">Source:</dt>
  123. <dd class="tag-source"><ul class="dummy"><li>
  124. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line172">line 172</a>
  125. </li></ul></dd>
  126. </dl>
  127. <div class="description">
  128. Port Tor is bound to for API access.
  129. </div>
  130. <h5>Type:</h5>
  131. <ul>
  132. <li>
  133. <span class="param-type">number</span>
  134. </li>
  135. </ul>
  136. <h4 class="name" id="control_port_connected"><span class="type-signature"></span>control_port_connected<span class="type-signature"> :boolean</span></h4>
  137. <dl class="details">
  138. <dt class="tag-source">Source:</dt>
  139. <dd class="tag-source"><ul class="dummy"><li>
  140. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line338">line 338</a>
  141. </li></ul></dd>
  142. </dl>
  143. <div class="description">
  144. Is true when the connected via the control protcol
  145. </div>
  146. <h5>Type:</h5>
  147. <ul>
  148. <li>
  149. <span class="param-type">boolean</span>
  150. </li>
  151. </ul>
  152. <h4 class="name" id="controller"><span class="type-signature">(readonly) </span>controller<span class="type-signature"> :TorController</span></h4>
  153. <dl class="details">
  154. <dt class="tag-source">Source:</dt>
  155. <dd class="tag-source"><ul class="dummy"><li>
  156. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line182">line 182</a>
  157. </li></ul></dd>
  158. </dl>
  159. <div class="description">
  160. Instance of granax.TorController connected to the Tor process.
  161. </div>
  162. <h5>Type:</h5>
  163. <ul>
  164. <li>
  165. <span class="param-type">TorController</span>
  166. </li>
  167. </ul>
  168. <h4 class="name" id="definition"><span class="type-signature">(readonly) </span>definition<span class="type-signature"> :string</span></h4>
  169. <dl class="details">
  170. <dt class="tag-source">Source:</dt>
  171. <dd class="tag-source"><ul class="dummy"><li>
  172. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line136">line 136</a>
  173. </li></ul></dd>
  174. </dl>
  175. <div class="description">
  176. The definition used to create the instance.
  177. </div>
  178. <h5>Type:</h5>
  179. <ul>
  180. <li>
  181. <span class="param-type">string</span>
  182. </li>
  183. </ul>
  184. <h4 class="name" id="dns_port"><span class="type-signature">(readonly) </span>dns_port<span class="type-signature"> :number</span></h4>
  185. <dl class="details">
  186. <dt class="tag-source">Source:</dt>
  187. <dd class="tag-source"><ul class="dummy"><li>
  188. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line152">line 152</a>
  189. </li></ul></dd>
  190. </dl>
  191. <div class="description">
  192. Port Tor is bound to for DNS traffic.
  193. </div>
  194. <h5>Type:</h5>
  195. <ul>
  196. <li>
  197. <span class="param-type">number</span>
  198. </li>
  199. </ul>
  200. <h4 class="name" id="granax_options"><span class="type-signature"></span>granax_options<span class="type-signature"> :Object</span></h4>
  201. <dl class="details">
  202. <dt class="tag-source">Source:</dt>
  203. <dd class="tag-source"><ul class="dummy"><li>
  204. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line70">line 70</a>
  205. </li></ul></dd>
  206. </dl>
  207. <div class="description">
  208. Object containing options that will be passed to granax.
  209. </div>
  210. <h5>Type:</h5>
  211. <ul>
  212. <li>
  213. <span class="param-type">Object</span>
  214. </li>
  215. </ul>
  216. <h4 class="name" id="id"><span class="type-signature">(readonly) </span>id<span class="type-signature"> :string</span></h4>
  217. <dl class="details">
  218. <dt class="tag-source">Source:</dt>
  219. <dd class="tag-source"><ul class="dummy"><li>
  220. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line108">line 108</a>
  221. </li></ul></dd>
  222. </dl>
  223. <div class="description">
  224. The unique identifier assigned to each instance.
  225. </div>
  226. <h5>Type:</h5>
  227. <ul>
  228. <li>
  229. <span class="param-type">string</span>
  230. </li>
  231. </ul>
  232. <h4 class="name" id="instance_group"><span class="type-signature">(readonly) </span>instance_group<span class="type-signature"> :<a href="Array.html">Array</a>.&lt;string></span></h4>
  233. <dl class="details">
  234. <dt class="tag-source">Source:</dt>
  235. <dd class="tag-source"><ul class="dummy"><li>
  236. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line116">line 116</a>
  237. </li></ul></dd>
  238. </dl>
  239. <div class="description">
  240. Groups the instance are currently in.
  241. </div>
  242. <h5>Type:</h5>
  243. <ul>
  244. <li>
  245. <span class="param-type"><a href="Array.html">Array</a>.&lt;string></span>
  246. </li>
  247. </ul>
  248. <h4 class="name" id="instance_name"><span class="type-signature">(readonly) </span>instance_name<span class="type-signature"> :string</span></h4>
  249. <dl class="details">
  250. <dt class="tag-source">Source:</dt>
  251. <dd class="tag-source"><ul class="dummy"><li>
  252. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line126">line 126</a>
  253. </li></ul></dd>
  254. </dl>
  255. <div class="description">
  256. Either the "Name" property of the definition or the <a href="TorProcess.html#id">TorProcess#id</a> property.
  257. </div>
  258. <h5>Type:</h5>
  259. <ul>
  260. <li>
  261. <span class="param-type">string</span>
  262. </li>
  263. </ul>
  264. <h4 class="name" id="ready"><span class="type-signature">(readonly) </span>ready<span class="type-signature"> :boolean</span></h4>
  265. <dl class="details">
  266. <dt class="tag-source">Source:</dt>
  267. <dd class="tag-source"><ul class="dummy"><li>
  268. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line192">line 192</a>
  269. </li></ul></dd>
  270. </dl>
  271. <div class="description">
  272. Property identifiyng whether Tor has started.
  273. </div>
  274. <h5>Type:</h5>
  275. <ul>
  276. <li>
  277. <span class="param-type">boolean</span>
  278. </li>
  279. </ul>
  280. <h4 class="name" id="socks_port"><span class="type-signature">(readonly) </span>socks_port<span class="type-signature"> :number</span></h4>
  281. <dl class="details">
  282. <dt class="tag-source">Source:</dt>
  283. <dd class="tag-source"><ul class="dummy"><li>
  284. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line162">line 162</a>
  285. </li></ul></dd>
  286. </dl>
  287. <div class="description">
  288. Port Tor is bound to for SOCKS5 traffic.
  289. </div>
  290. <h5>Type:</h5>
  291. <ul>
  292. <li>
  293. <span class="param-type">number</span>
  294. </li>
  295. </ul>
  296. <h4 class="name" id="tor_config"><span class="type-signature">(readonly) </span>tor_config<span class="type-signature"> :Object</span></h4>
  297. <dl class="details">
  298. <dt class="tag-source">Source:</dt>
  299. <dd class="tag-source"><ul class="dummy"><li>
  300. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line144">line 144</a>
  301. </li></ul></dd>
  302. </dl>
  303. <div class="description">
  304. The configuration passed to Tor. The same value as `definition.Config`.
  305. </div>
  306. <h5>Type:</h5>
  307. <ul>
  308. <li>
  309. <span class="param-type">Object</span>
  310. </li>
  311. </ul>
  312. <h4 class="name" id="tor_path"><span class="type-signature"></span>tor_path<span class="type-signature"> :string</span></h4>
  313. <dl class="details">
  314. <dt class="tag-source">Source:</dt>
  315. <dd class="tag-source"><ul class="dummy"><li>
  316. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line62">line 62</a>
  317. </li></ul></dd>
  318. </dl>
  319. <div class="description">
  320. Path to the Tor executable.
  321. </div>
  322. <h5>Type:</h5>
  323. <ul>
  324. <li>
  325. <span class="param-type">string</span>
  326. </li>
  327. </ul>
  328. <h3 class="subsection-title">Methods</h3>
  329. <h4 class="name" id="create"><span class="type-signature">(async) </span>create<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;ChildProcess>}</span></h4>
  330. <dl class="details">
  331. <dt class="tag-source">Source:</dt>
  332. <dd class="tag-source"><ul class="dummy"><li>
  333. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line265">line 265</a>
  334. </li></ul></dd>
  335. </dl>
  336. <div class="description">
  337. Creates the Tor process based on the configuration provided. Promise is resolved when the process has been started.
  338. </div>
  339. <h5>Returns:</h5>
  340. <div class="param-desc">
  341. - The process that has been created.
  342. </div>
  343. <dl class="param-type">
  344. <dt>
  345. Type
  346. </dt>
  347. <dd>
  348. <span class="param-type">Promise.&lt;ChildProcess></span>
  349. </dd>
  350. </dl>
  351. <h4 class="name" id="exit"><span class="type-signature">(async) </span>exit<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  352. <dl class="details">
  353. <dt class="tag-source">Source:</dt>
  354. <dd class="tag-source"><ul class="dummy"><li>
  355. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line90">line 90</a>
  356. </li></ul></dd>
  357. </dl>
  358. <div class="description">
  359. Kills the Tor process.
  360. </div>
  361. <h5>Returns:</h5>
  362. <dl class="param-type">
  363. <dt>
  364. Type
  365. </dt>
  366. <dd>
  367. <span class="param-type">Promise</span>
  368. </dd>
  369. </dl>
  370. <h4 class="name" id="get_config"><span class="type-signature">(async) </span>get_config<span class="signature">(keyword)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Array.html">Array</a>.&lt;string>>}</span></h4>
  371. <dl class="details">
  372. <dt class="tag-source">Source:</dt>
  373. <dd class="tag-source"><ul class="dummy"><li>
  374. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line216">line 216</a>
  375. </li></ul></dd>
  376. </dl>
  377. <div class="description">
  378. Retrieves a configuration value from the instance via the control protocol.
  379. </div>
  380. <h5>Parameters:</h5>
  381. <table class="params">
  382. <thead>
  383. <tr>
  384. <th>Name</th>
  385. <th>Type</th>
  386. <th class="last">Description</th>
  387. </tr>
  388. </thead>
  389. <tbody>
  390. <tr>
  391. <td class="name"><code>keyword</code></td>
  392. <td class="type">
  393. <span class="param-type">string</span>
  394. </td>
  395. <td class="description last">The name of the configuration property to retrieve.</td>
  396. </tr>
  397. </tbody>
  398. </table>
  399. <h5>Throws:</h5>
  400. <div class="param-desc">
  401. Will throw an error if not connected to the control protocol.
  402. </div>
  403. <h5>Returns:</h5>
  404. <dl class="param-type">
  405. <dt>
  406. Type
  407. </dt>
  408. <dd>
  409. <span class="param-type">Promise.&lt;<a href="Array.html">Array</a>.&lt;string>></span>
  410. </dd>
  411. </dl>
  412. <h4 class="name" id="new_identity"><span class="type-signature">(async) </span>new_identity<span class="signature">()</span><span class="type-signature"></span></h4>
  413. <dl class="details">
  414. <dt class="tag-source">Source:</dt>
  415. <dd class="tag-source"><ul class="dummy"><li>
  416. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line201">line 201</a>
  417. </li></ul></dd>
  418. </dl>
  419. <div class="description">
  420. Requests a new identity via the control protocol.
  421. </div>
  422. <h4 class="name" id="set_config"><span class="type-signature">(async) </span>set_config<span class="signature">(keyword, value)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  423. <dl class="details">
  424. <dt class="tag-source">Source:</dt>
  425. <dd class="tag-source"><ul class="dummy"><li>
  426. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line233">line 233</a>
  427. </li></ul></dd>
  428. </dl>
  429. <div class="description">
  430. Sets a configuration value for the instance via the control protocol.
  431. </div>
  432. <h5>Parameters:</h5>
  433. <table class="params">
  434. <thead>
  435. <tr>
  436. <th>Name</th>
  437. <th>Type</th>
  438. <th class="last">Description</th>
  439. </tr>
  440. </thead>
  441. <tbody>
  442. <tr>
  443. <td class="name"><code>keyword</code></td>
  444. <td class="type">
  445. <span class="param-type">string</span>
  446. </td>
  447. <td class="description last">The name of the configuration property to retrieve.</td>
  448. </tr>
  449. <tr>
  450. <td class="name"><code>value</code></td>
  451. <td class="type">
  452. <span class="param-type">any</span>
  453. </td>
  454. <td class="description last">Value to set the property to.</td>
  455. </tr>
  456. </tbody>
  457. </table>
  458. <h5>Throws:</h5>
  459. <div class="param-desc">
  460. Will throw an error if not connected to the control protocol.
  461. </div>
  462. <h5>Returns:</h5>
  463. <dl class="param-type">
  464. <dt>
  465. Type
  466. </dt>
  467. <dd>
  468. <span class="param-type">Promise</span>
  469. </dd>
  470. </dl>
  471. <h4 class="name" id="signal"><span class="type-signature">(async) </span>signal<span class="signature">(signal)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  472. <dl class="details">
  473. <dt class="tag-source">Source:</dt>
  474. <dd class="tag-source"><ul class="dummy"><li>
  475. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line250">line 250</a>
  476. </li></ul></dd>
  477. </dl>
  478. <div class="description">
  479. Sends a signal via the control tnterface.
  480. </div>
  481. <h5>Parameters:</h5>
  482. <table class="params">
  483. <thead>
  484. <tr>
  485. <th>Name</th>
  486. <th>Type</th>
  487. <th class="last">Description</th>
  488. </tr>
  489. </thead>
  490. <tbody>
  491. <tr>
  492. <td class="name"><code>signal</code></td>
  493. <td class="type">
  494. <span class="param-type">string</span>
  495. </td>
  496. <td class="description last">The signal to send.</td>
  497. </tr>
  498. </tbody>
  499. </table>
  500. <h5>Throws:</h5>
  501. <div class="param-desc">
  502. Will throw an error if not connected to the control protocol.
  503. </div>
  504. <h5>Returns:</h5>
  505. <dl class="param-type">
  506. <dt>
  507. Type
  508. </dt>
  509. <dd>
  510. <span class="param-type">Promise</span>
  511. </dd>
  512. </dl>
  513. <h3 class="subsection-title">Events</h3>
  514. <h4 class="name" id="event:control_listen">control_listen</h4>
  515. <dl class="details">
  516. <dt class="tag-source">Source:</dt>
  517. <dd class="tag-source"><ul class="dummy"><li>
  518. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line369">line 369</a>
  519. </li></ul></dd>
  520. </dl>
  521. <div class="description">
  522. An event that fires when the Tor process has started listening for control interface traffic.
  523. </div>
  524. <h4 class="name" id="event:controller_ready">controller_ready</h4>
  525. <dl class="details">
  526. <dt class="tag-source">Source:</dt>
  527. <dd class="tag-source"><ul class="dummy"><li>
  528. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line339">line 339</a>
  529. </li></ul></dd>
  530. </dl>
  531. <div class="description">
  532. An event that fires when a connection has been established to the control protocol.
  533. </div>
  534. <h4 class="name" id="event:dns_listen">dns_listen</h4>
  535. <dl class="details">
  536. <dt class="tag-source">Source:</dt>
  537. <dd class="tag-source"><ul class="dummy"><li>
  538. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line389">line 389</a>
  539. </li></ul></dd>
  540. </dl>
  541. <div class="description">
  542. An event that fires when the Tor process has started listening for DNS traffic.
  543. </div>
  544. <h4 class="name" id="event:error">error</h4>
  545. <dl class="details">
  546. <dt class="tag-source">Source:</dt>
  547. <dd class="tag-source"><ul class="dummy"><li>
  548. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line398">line 398</a>
  549. </li></ul></dd>
  550. </dl>
  551. <div class="description">
  552. An event that fires when the Tor process has written an error to stdout, stderr or when an error occurs connecting via the control protocol.
  553. </div>
  554. <h5>Type:</h5>
  555. <ul>
  556. <li>
  557. <span class="param-type">Error</span>
  558. </li>
  559. </ul>
  560. <h5>Returns:</h5>
  561. <dl class="param-type">
  562. <dt>
  563. Type
  564. </dt>
  565. <dd>
  566. <span class="param-type">Error</span>
  567. </dd>
  568. </dl>
  569. <h4 class="name" id="event:process_exit">process_exit</h4>
  570. <dl class="details">
  571. <dt class="tag-source">Source:</dt>
  572. <dd class="tag-source"><ul class="dummy"><li>
  573. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line296">line 296</a>
  574. </li></ul></dd>
  575. </dl>
  576. <div class="description">
  577. An event that fires when the process has closed.
  578. </div>
  579. <h5>Type:</h5>
  580. <ul>
  581. <li>
  582. <span class="param-type">number</span>
  583. </li>
  584. </ul>
  585. <h5>Parameters:</h5>
  586. <table class="params">
  587. <thead>
  588. <tr>
  589. <th>Name</th>
  590. <th>Type</th>
  591. <th class="last">Description</th>
  592. </tr>
  593. </thead>
  594. <tbody>
  595. <tr>
  596. <td class="name"><code>code</code></td>
  597. <td class="type">
  598. <span class="param-type">number</span>
  599. </td>
  600. <td class="description last">The exit code from the process.</td>
  601. </tr>
  602. </tbody>
  603. </table>
  604. <h4 class="name" id="event:ready">ready</h4>
  605. <dl class="details">
  606. <dt class="tag-source">Source:</dt>
  607. <dd class="tag-source"><ul class="dummy"><li>
  608. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line359">line 359</a>
  609. </li></ul></dd>
  610. </dl>
  611. <div class="description">
  612. An event that fires when the Tor process is fully bootstrapped (and ready for traffic).
  613. </div>
  614. <h4 class="name" id="event:socks_listen">socks_listen</h4>
  615. <dl class="details">
  616. <dt class="tag-source">Source:</dt>
  617. <dd class="tag-source"><ul class="dummy"><li>
  618. <a href="TorProcess.js.html">TorProcess.js</a>, <a href="TorProcess.js.html#line379">line 379</a>
  619. </li></ul></dd>
  620. </dl>
  621. <div class="description">
  622. An event that fires when the Tor process has started listening for SOCKS5 traffic.
  623. </div>
  624. </article>
  625. </section>
  626. </div>
  627. <br class="clear">
  628. <footer>
  629. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 12:53:23 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
  630. </footer>
  631. <script>prettyPrint();</script>
  632. <script src="scripts/linenumber.js"></script>
  633. </body>
  634. </html>