TorPool.html 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TorPool - 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">TorPool</h1>
  26. <section>
  27. <header>
  28. <h2>
  29. TorPool
  30. </h2>
  31. <div class="class-description">Class that represents a pool of Tor processes.</div>
  32. </header>
  33. <article>
  34. <div class="container-overview">
  35. <h2>Constructor</h2>
  36. <h4 class="name" id="TorPool"><span class="type-signature"></span>new TorPool<span class="signature">(tor_path, default_config<span class="signature-attributes">opt</span>, data_directory, load_balance_method, 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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line38">line 38</a>
  41. </li></ul></dd>
  42. </dl>
  43. <div class="description">
  44. Creates an instance of `TorPool`.
  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>default_config</code></td>
  68. <td class="type">
  69. <span class="param-type">Object</span>
  70. |
  71. <span class="param-type">function</span>
  72. </td>
  73. <td class="attributes">
  74. &lt;optional><br>
  75. </td>
  76. <td class="description last">Default configuration that will be passed to all Tor instances created. Can be a function. See <a href="https://bit.ly/2QrmI3o">Tor Documentation</a> for all possible options</td>
  77. </tr>
  78. <tr>
  79. <td class="name"><code>data_directory</code></td>
  80. <td class="type">
  81. <span class="param-type">string</span>
  82. </td>
  83. <td class="attributes">
  84. </td>
  85. <td class="description last">Parent directory for the data directory of each proccess.</td>
  86. </tr>
  87. <tr>
  88. <td class="name"><code>load_balance_method</code></td>
  89. <td class="type">
  90. <span class="param-type">string</span>
  91. </td>
  92. <td class="attributes">
  93. </td>
  94. <td class="description last">Name of the load balance method to use. See TorPool#load_balance_methods.</td>
  95. </tr>
  96. <tr>
  97. <td class="name"><code>granax_options</code></td>
  98. <td class="type">
  99. <span class="param-type">string</span>
  100. </td>
  101. <td class="attributes">
  102. &lt;optional><br>
  103. </td>
  104. <td class="description last">Object containing options that will be passed to granax for each instance.</td>
  105. </tr>
  106. <tr>
  107. <td class="name"><code>logger</code></td>
  108. <td class="type">
  109. <span class="param-type">string</span>
  110. </td>
  111. <td class="attributes">
  112. &lt;optional><br>
  113. </td>
  114. <td class="description last">A winston logger. If not provided no logging will occur.</td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. <h3 class="subsection-title">Extends</h3>
  120. <ul>
  121. <li>EventEmitter</li>
  122. </ul>
  123. <h3 class="subsection-title">Members</h3>
  124. <h4 class="name" id=".load_balance_methods"><span class="type-signature">(static, readonly) </span>load_balance_methods<span class="type-signature"> :function</span></h4>
  125. <dl class="details">
  126. <dt class="tag-source">Source:</dt>
  127. <dd class="tag-source"><ul class="dummy"><li>
  128. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line350">line 350</a>
  129. </li></ul></dd>
  130. </dl>
  131. <div class="description">
  132. Returns an enumeration of load balance methods as functions
  133. </div>
  134. <h5>Type:</h5>
  135. <ul>
  136. <li>
  137. <span class="param-type">function</span>
  138. </li>
  139. </ul>
  140. <h4 class="name" id="data_directory"><span class="type-signature"></span>data_directory<span class="type-signature"> :string</span></h4>
  141. <dl class="details">
  142. <dt class="tag-source">Source:</dt>
  143. <dd class="tag-source"><ul class="dummy"><li>
  144. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line63">line 63</a>
  145. </li></ul></dd>
  146. </dl>
  147. <div class="description">
  148. Parent directory for the data directory of each proccess.
  149. </div>
  150. <h5>Type:</h5>
  151. <ul>
  152. <li>
  153. <span class="param-type">string</span>
  154. </li>
  155. </ul>
  156. <h4 class="name" id="default_tor_config"><span class="type-signature"></span>default_tor_config<span class="type-signature"> :Object|function</span></h4>
  157. <dl class="details">
  158. <dt class="tag-source">Source:</dt>
  159. <dd class="tag-source"><ul class="dummy"><li>
  160. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line327">line 327</a>
  161. </li></ul></dd>
  162. </dl>
  163. <div class="description">
  164. Getter
  165. </div>
  166. <h5>Type:</h5>
  167. <ul>
  168. <li>
  169. <span class="param-type">Object</span>
  170. |
  171. <span class="param-type">function</span>
  172. </li>
  173. </ul>
  174. <h4 class="name" id="default_tor_config"><span class="type-signature"></span>default_tor_config<span class="type-signature"></span></h4>
  175. <dl class="details">
  176. <dt class="tag-source">Source:</dt>
  177. <dd class="tag-source"><ul class="dummy"><li>
  178. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line341">line 341</a>
  179. </li></ul></dd>
  180. </dl>
  181. <div class="description">
  182. Setter
  183. </div>
  184. <h4 class="name" id="granax_options"><span class="type-signature"></span>granax_options<span class="type-signature"> :Logger</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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line91">line 91</a>
  189. </li></ul></dd>
  190. </dl>
  191. <div class="description">
  192. Object containing options that will be passed to granax for each instance.
  193. </div>
  194. <h5>Type:</h5>
  195. <ul>
  196. <li>
  197. <span class="param-type">Logger</span>
  198. </li>
  199. </ul>
  200. <h4 class="name" id="group_names"><span class="type-signature">(readonly) </span>group_names<span class="type-signature"> :Set.&lt;string></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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line100">line 100</a>
  205. </li></ul></dd>
  206. </dl>
  207. <div class="description">
  208. Returns a Set containing the names of all of the groups.
  209. </div>
  210. <h5>Type:</h5>
  211. <ul>
  212. <li>
  213. <span class="param-type">Set.&lt;string></span>
  214. </li>
  215. </ul>
  216. <h4 class="name" id="groups"><span class="type-signature">(readonly) </span>groups<span class="type-signature"> :<a href="global.html#InstanceGroupCollection">InstanceGroupCollection</a></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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line238">line 238</a>
  221. </li></ul></dd>
  222. </dl>
  223. <div class="description">
  224. Represents all groups currently in the pool.
  225. </div>
  226. <h5>Type:</h5>
  227. <ul>
  228. <li>
  229. <span class="param-type"><a href="global.html#InstanceGroupCollection">InstanceGroupCollection</a></span>
  230. </li>
  231. </ul>
  232. <h4 class="name" id="instance_names"><span class="type-signature">(readonly) </span>instance_names<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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line386">line 386</a>
  237. </li></ul></dd>
  238. </dl>
  239. <div class="description">
  240. An array containing the names of the instances in the pool.
  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="instances"><span class="type-signature">(readonly) </span>instances<span class="type-signature"> :<a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>></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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line376">line 376</a>
  253. </li></ul></dd>
  254. </dl>
  255. <div class="description">
  256. An array containing all instances in the pool.
  257. </div>
  258. <h5>Type:</h5>
  259. <ul>
  260. <li>
  261. <span class="param-type"><a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>></span>
  262. </li>
  263. </ul>
  264. <h4 class="name" id="load_balance_method"><span class="type-signature"></span>load_balance_method<span class="type-signature"> :string</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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line70">line 70</a>
  269. </li></ul></dd>
  270. </dl>
  271. <div class="description">
  272. Name of the load balance method to use.
  273. </div>
  274. <h5>Type:</h5>
  275. <ul>
  276. <li>
  277. <span class="param-type">string</span>
  278. </li>
  279. </ul>
  280. <h4 class="name" id="logger"><span class="type-signature"></span>logger<span class="type-signature"> :Logger</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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line84">line 84</a>
  285. </li></ul></dd>
  286. </dl>
  287. <div class="description">
  288. The winston logger.
  289. </div>
  290. <h5>Type:</h5>
  291. <ul>
  292. <li>
  293. <span class="param-type">Logger</span>
  294. </li>
  295. </ul>
  296. <h4 class="name" id="tor_path"><span class="type-signature"></span>tor_path<span class="type-signature"> :string</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="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line77">line 77</a>
  301. </li></ul></dd>
  302. </dl>
  303. <div class="description">
  304. Path to the Tor executable.
  305. </div>
  306. <h5>Type:</h5>
  307. <ul>
  308. <li>
  309. <span class="param-type">string</span>
  310. </li>
  311. </ul>
  312. <h3 class="subsection-title">Methods</h3>
  313. <h4 class="name" id="add"><span class="type-signature">(async) </span>add<span class="signature">(instance_definitions)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>>>}</span></h4>
  314. <dl class="details">
  315. <dt class="tag-source">Source:</dt>
  316. <dd class="tag-source"><ul class="dummy"><li>
  317. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line443">line 443</a>
  318. </li></ul></dd>
  319. </dl>
  320. <div class="description">
  321. Adds one or more instances to the pool from an array of definitions or single definition.
  322. </div>
  323. <h5>Parameters:</h5>
  324. <table class="params">
  325. <thead>
  326. <tr>
  327. <th>Name</th>
  328. <th>Type</th>
  329. <th class="last">Description</th>
  330. </tr>
  331. </thead>
  332. <tbody>
  333. <tr>
  334. <td class="name"><code>instance_definitions</code></td>
  335. <td class="type">
  336. <span class="param-type"><a href="Array.html">Array</a>.&lt;<a href="global.html#InstanceDefinition">InstanceDefinition</a>></span>
  337. |
  338. <span class="param-type"><a href="global.html#InstanceDefinition">InstanceDefinition</a></span>
  339. </td>
  340. <td class="description last"></td>
  341. </tr>
  342. </tbody>
  343. </table>
  344. <h5>Throws:</h5>
  345. <div class="param-desc">
  346. If `instance_definitions` is falsy.
  347. </div>
  348. <h5>Returns:</h5>
  349. <dl class="param-type">
  350. <dt>
  351. Type
  352. </dt>
  353. <dd>
  354. <span class="param-type">Promise.&lt;<a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>>></span>
  355. </dd>
  356. </dl>
  357. <h4 class="name" id="add_instance_to_group"><span class="type-signature"></span>add_instance_to_group<span class="signature">(group, instance)</span><span class="type-signature"></span></h4>
  358. <dl class="details">
  359. <dt class="tag-source">Source:</dt>
  360. <dd class="tag-source"><ul class="dummy"><li>
  361. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line132">line 132</a>
  362. </li></ul></dd>
  363. </dl>
  364. <div class="description">
  365. Adds an instance to a group. If the group doesn't exist it will be created.
  366. </div>
  367. <h5>Parameters:</h5>
  368. <table class="params">
  369. <thead>
  370. <tr>
  371. <th>Name</th>
  372. <th>Type</th>
  373. <th class="last">Description</th>
  374. </tr>
  375. </thead>
  376. <tbody>
  377. <tr>
  378. <td class="name"><code>group</code></td>
  379. <td class="type">
  380. <span class="param-type">string</span>
  381. </td>
  382. <td class="description last">The group to add the instance to.</td>
  383. </tr>
  384. <tr>
  385. <td class="name"><code>instance</code></td>
  386. <td class="type">
  387. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  388. </td>
  389. <td class="description last">The instance in question.</td>
  390. </tr>
  391. </tbody>
  392. </table>
  393. <h4 class="name" id="add_instance_to_group_at"><span class="type-signature"></span>add_instance_to_group_at<span class="signature">(group, instance_index)</span><span class="type-signature"></span></h4>
  394. <dl class="details">
  395. <dt class="tag-source">Source:</dt>
  396. <dd class="tag-source"><ul class="dummy"><li>
  397. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line160">line 160</a>
  398. </li></ul></dd>
  399. </dl>
  400. <div class="description">
  401. Adds an instance to a group by the index of the instance in the pool. If the group doesn't exist it will be created.
  402. </div>
  403. <h5>Parameters:</h5>
  404. <table class="params">
  405. <thead>
  406. <tr>
  407. <th>Name</th>
  408. <th>Type</th>
  409. <th class="last">Description</th>
  410. </tr>
  411. </thead>
  412. <tbody>
  413. <tr>
  414. <td class="name"><code>group</code></td>
  415. <td class="type">
  416. <span class="param-type">string</span>
  417. </td>
  418. <td class="description last">The group to add the instance to.</td>
  419. </tr>
  420. <tr>
  421. <td class="name"><code>instance_index</code></td>
  422. <td class="type">
  423. <span class="param-type">number</span>
  424. </td>
  425. <td class="description last">The index of the instance in question.</td>
  426. </tr>
  427. </tbody>
  428. </table>
  429. <h5>Throws:</h5>
  430. <div class="param-desc">
  431. If an instance with the index provided does not exist.
  432. </div>
  433. <h4 class="name" id="add_instance_to_group_by_name"><span class="type-signature"></span>add_instance_to_group_by_name<span class="signature">(group, instance_name)</span><span class="type-signature"></span></h4>
  434. <dl class="details">
  435. <dt class="tag-source">Source:</dt>
  436. <dd class="tag-source"><ul class="dummy"><li>
  437. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line144">line 144</a>
  438. </li></ul></dd>
  439. </dl>
  440. <div class="description">
  441. Adds an instance to a group by the <a href="TorProcess.html#instance_name">TorProcess#instance_name</a> property on the instance. If the group doesn't exist it will be created.
  442. </div>
  443. <h5>Parameters:</h5>
  444. <table class="params">
  445. <thead>
  446. <tr>
  447. <th>Name</th>
  448. <th>Type</th>
  449. <th class="last">Description</th>
  450. </tr>
  451. </thead>
  452. <tbody>
  453. <tr>
  454. <td class="name"><code>group</code></td>
  455. <td class="type">
  456. <span class="param-type">string</span>
  457. </td>
  458. <td class="description last">The group to add the instance to.</td>
  459. </tr>
  460. <tr>
  461. <td class="name"><code>instance_name</code></td>
  462. <td class="type">
  463. <span class="param-type">string</span>
  464. </td>
  465. <td class="description last">The name of the instance in question.</td>
  466. </tr>
  467. </tbody>
  468. </table>
  469. <h5>Throws:</h5>
  470. <div class="param-desc">
  471. If an instance with the name provided does not exist
  472. </div>
  473. <h4 class="name" id="create"><span class="type-signature">(async) </span>create<span class="signature">(instance_definitions)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>>>}</span></h4>
  474. <dl class="details">
  475. <dt class="tag-source">Source:</dt>
  476. <dd class="tag-source"><ul class="dummy"><li>
  477. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line459">line 459</a>
  478. </li></ul></dd>
  479. </dl>
  480. <div class="description">
  481. Creates one or more instances to the pool from either an array of definitions, a single definition or a number.
  482. If a number is provided it will create n instances with empty definitions (e.g. `TorPool.create(5)` will create 5 instances).
  483. </div>
  484. <h5>Parameters:</h5>
  485. <table class="params">
  486. <thead>
  487. <tr>
  488. <th>Name</th>
  489. <th>Type</th>
  490. <th class="last">Description</th>
  491. </tr>
  492. </thead>
  493. <tbody>
  494. <tr>
  495. <td class="name"><code>instance_definitions</code></td>
  496. <td class="type">
  497. <span class="param-type"><a href="Array.html">Array</a>.&lt;<a href="global.html#InstanceDefinition">InstanceDefinition</a>></span>
  498. |
  499. <span class="param-type"><a href="global.html#InstanceDefinition">InstanceDefinition</a></span>
  500. |
  501. <span class="param-type">number</span>
  502. </td>
  503. <td class="description last"></td>
  504. </tr>
  505. </tbody>
  506. </table>
  507. <h5>Throws:</h5>
  508. <div class="param-desc">
  509. If `instances` is falsy.
  510. </div>
  511. <h5>Returns:</h5>
  512. <dl class="param-type">
  513. <dt>
  514. Type
  515. </dt>
  516. <dd>
  517. <span class="param-type">Promise.&lt;<a href="Array.html">Array</a>.&lt;<a href="TorProcess.html">TorProcess</a>>></span>
  518. </dd>
  519. </dl>
  520. <h4 class="name" id="create_instance"><span class="type-signature">(async) </span>create_instance<span class="signature">(instance_definition<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="TorProcess.html">TorProcess</a>>}</span></h4>
  521. <dl class="details">
  522. <dt class="tag-source">Source:</dt>
  523. <dd class="tag-source"><ul class="dummy"><li>
  524. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line400">line 400</a>
  525. </li></ul></dd>
  526. </dl>
  527. <div class="description">
  528. Creates an instance then adds it to the pool from the provided definiton.
  529. Instance will be added (and Promise will resolve) after the instance is fully bootstrapped.
  530. </div>
  531. <h5>Parameters:</h5>
  532. <table class="params">
  533. <thead>
  534. <tr>
  535. <th>Name</th>
  536. <th>Type</th>
  537. <th>Attributes</th>
  538. <th>Default</th>
  539. <th class="last">Description</th>
  540. </tr>
  541. </thead>
  542. <tbody>
  543. <tr>
  544. <td class="name"><code>instance_definition</code></td>
  545. <td class="type">
  546. <span class="param-type"><a href="global.html#InstanceDefinition">InstanceDefinition</a></span>
  547. </td>
  548. <td class="attributes">
  549. &lt;optional><br>
  550. </td>
  551. <td class="default">
  552. <code>{}</code>
  553. </td>
  554. <td class="description last">Instance definition that will be used to create the instance.</td>
  555. </tr>
  556. </tbody>
  557. </table>
  558. <h5>Throws:</h5>
  559. <div class="param-desc">
  560. If an instance with the same InstanceDefinition#Name already exists.
  561. </div>
  562. <h5>Returns:</h5>
  563. <div class="param-desc">
  564. - The instance that was created.
  565. </div>
  566. <dl class="param-type">
  567. <dt>
  568. Type
  569. </dt>
  570. <dd>
  571. <span class="param-type">Promise.&lt;<a href="TorProcess.html">TorProcess</a>></span>
  572. </dd>
  573. </dl>
  574. <h4 class="name" id="exit"><span class="type-signature">(async) </span>exit<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  575. <dl class="details">
  576. <dt class="tag-source">Source:</dt>
  577. <dd class="tag-source"><ul class="dummy"><li>
  578. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line561">line 561</a>
  579. </li></ul></dd>
  580. </dl>
  581. <div class="description">
  582. Kills the Tor processes of all instances in the pool.
  583. </div>
  584. <h5>Returns:</h5>
  585. <div class="param-desc">
  586. - Resolves when all instances have been killed.
  587. </div>
  588. <dl class="param-type">
  589. <dt>
  590. Type
  591. </dt>
  592. <dd>
  593. <span class="param-type">Promise</span>
  594. </dd>
  595. </dl>
  596. <h4 class="name" id="get_config_at"><span class="type-signature">(async) </span>get_config_at<span class="signature">(index, keyword)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Array.html">Array</a>.&lt;string>>}</span></h4>
  597. <dl class="details">
  598. <dt class="tag-source">Source:</dt>
  599. <dd class="tag-source"><ul class="dummy"><li>
  600. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line663">line 663</a>
  601. </li></ul></dd>
  602. </dl>
  603. <div class="description">
  604. Get a configuration value from the instance at the index in the pool via the control protocol.
  605. </div>
  606. <h5>Parameters:</h5>
  607. <table class="params">
  608. <thead>
  609. <tr>
  610. <th>Name</th>
  611. <th>Type</th>
  612. <th class="last">Description</th>
  613. </tr>
  614. </thead>
  615. <tbody>
  616. <tr>
  617. <td class="name"><code>index</code></td>
  618. <td class="type">
  619. <span class="param-type">number</span>
  620. </td>
  621. <td class="description last">Index of the instance in the pool.</td>
  622. </tr>
  623. <tr>
  624. <td class="name"><code>keyword</code></td>
  625. <td class="type">
  626. <span class="param-type">string</span>
  627. </td>
  628. <td class="description last">Name of the configuration property.</td>
  629. </tr>
  630. </tbody>
  631. </table>
  632. <h5>Throws:</h5>
  633. <div class="param-desc">
  634. When no instance exists at the provided index.
  635. </div>
  636. <h5>Returns:</h5>
  637. <div class="param-desc">
  638. - The configuration property's value.
  639. </div>
  640. <dl class="param-type">
  641. <dt>
  642. Type
  643. </dt>
  644. <dd>
  645. <span class="param-type">Promise.&lt;<a href="Array.html">Array</a>.&lt;string>></span>
  646. </dd>
  647. </dl>
  648. <h4 class="name" id="get_config_by_name"><span class="type-signature">(async) </span>get_config_by_name<span class="signature">(name, keyword)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Array.html">Array</a>.&lt;string>>}</span></h4>
  649. <dl class="details">
  650. <dt class="tag-source">Source:</dt>
  651. <dd class="tag-source"><ul class="dummy"><li>
  652. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line626">line 626</a>
  653. </li></ul></dd>
  654. </dl>
  655. <div class="description">
  656. Get a configuration value from the instance whose TorProcess.instance_name matches the provided name via the control protocol.
  657. </div>
  658. <h5>Parameters:</h5>
  659. <table class="params">
  660. <thead>
  661. <tr>
  662. <th>Name</th>
  663. <th>Type</th>
  664. <th class="last">Description</th>
  665. </tr>
  666. </thead>
  667. <tbody>
  668. <tr>
  669. <td class="name"><code>name</code></td>
  670. <td class="type">
  671. <span class="param-type">string</span>
  672. </td>
  673. <td class="description last">Name of the instance.</td>
  674. </tr>
  675. <tr>
  676. <td class="name"><code>keyword</code></td>
  677. <td class="type">
  678. <span class="param-type">string</span>
  679. </td>
  680. <td class="description last">Name of the configuration property.</td>
  681. </tr>
  682. </tbody>
  683. </table>
  684. <h5>Throws:</h5>
  685. <div class="param-desc">
  686. When no instance matched the provided name.
  687. </div>
  688. <h5>Returns:</h5>
  689. <div class="param-desc">
  690. - The configuration property's value.
  691. </div>
  692. <dl class="param-type">
  693. <dt>
  694. Type
  695. </dt>
  696. <dd>
  697. <span class="param-type">Promise.&lt;<a href="Array.html">Array</a>.&lt;string>></span>
  698. </dd>
  699. </dl>
  700. <h4 class="name" id="instance_at"><span class="type-signature"></span>instance_at<span class="signature">(index)</span><span class="type-signature"> &rarr; {<a href="TorProcess.html">TorProcess</a>}</span></h4>
  701. <dl class="details">
  702. <dt class="tag-source">Source:</dt>
  703. <dd class="tag-source"><ul class="dummy"><li>
  704. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line484">line 484</a>
  705. </li></ul></dd>
  706. </dl>
  707. <div class="description">
  708. Returns the instance located at the provided index in the pool.
  709. Is equivalent to `<a href="TorPool.html#instances">TorPool#instances</a>[index]`
  710. </div>
  711. <h5>Parameters:</h5>
  712. <table class="params">
  713. <thead>
  714. <tr>
  715. <th>Name</th>
  716. <th>Type</th>
  717. <th class="last">Description</th>
  718. </tr>
  719. </thead>
  720. <tbody>
  721. <tr>
  722. <td class="name"><code>index</code></td>
  723. <td class="type">
  724. <span class="param-type">number</span>
  725. </td>
  726. <td class="description last">Index of the instance in the pool</td>
  727. </tr>
  728. </tbody>
  729. </table>
  730. <h5>Returns:</h5>
  731. <div class="param-desc">
  732. - Matching instance
  733. </div>
  734. <dl class="param-type">
  735. <dt>
  736. Type
  737. </dt>
  738. <dd>
  739. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  740. </dd>
  741. </dl>
  742. <h4 class="name" id="instance_by_name"><span class="type-signature"></span>instance_by_name<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="TorProcess.html">TorProcess</a>}</span></h4>
  743. <dl class="details">
  744. <dt class="tag-source">Source:</dt>
  745. <dd class="tag-source"><ul class="dummy"><li>
  746. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line474">line 474</a>
  747. </li></ul></dd>
  748. </dl>
  749. <div class="description">
  750. Searches for an instance with the matching <a href="TorProcess.html#instance_name">TorProcess#instance_name</a> property.
  751. </div>
  752. <h5>Parameters:</h5>
  753. <table class="params">
  754. <thead>
  755. <tr>
  756. <th>Name</th>
  757. <th>Type</th>
  758. <th class="last">Description</th>
  759. </tr>
  760. </thead>
  761. <tbody>
  762. <tr>
  763. <td class="name"><code>name</code></td>
  764. <td class="type">
  765. <span class="param-type">string</span>
  766. </td>
  767. <td class="description last">Name of the instance to search for</td>
  768. </tr>
  769. </tbody>
  770. </table>
  771. <h5>Returns:</h5>
  772. <div class="param-desc">
  773. - Matching instance
  774. </div>
  775. <dl class="param-type">
  776. <dt>
  777. Type
  778. </dt>
  779. <dd>
  780. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  781. </dd>
  782. </dl>
  783. <h4 class="name" id="instances_by_group"><span class="type-signature"></span>instances_by_group<span class="signature">(group_name)</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>.&lt;string>}</span></h4>
  784. <dl class="details">
  785. <dt class="tag-source">Source:</dt>
  786. <dd class="tag-source"><ul class="dummy"><li>
  787. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line112">line 112</a>
  788. </li></ul></dd>
  789. </dl>
  790. <div class="description">
  791. Returns an array containing all of the instances in a group.
  792. </div>
  793. <h5>Parameters:</h5>
  794. <table class="params">
  795. <thead>
  796. <tr>
  797. <th>Name</th>
  798. <th>Type</th>
  799. <th class="last">Description</th>
  800. </tr>
  801. </thead>
  802. <tbody>
  803. <tr>
  804. <td class="name"><code>group_name</code></td>
  805. <td class="type">
  806. <span class="param-type">string</span>
  807. </td>
  808. <td class="description last">The group to query.</td>
  809. </tr>
  810. </tbody>
  811. </table>
  812. <h5>Throws:</h5>
  813. <div class="param-desc">
  814. If the provided group does not exist
  815. </div>
  816. <h5>Returns:</h5>
  817. <dl class="param-type">
  818. <dt>
  819. Type
  820. </dt>
  821. <dd>
  822. <span class="param-type"><a href="Array.html">Array</a>.&lt;string></span>
  823. </dd>
  824. </dl>
  825. <h4 class="name" id="new_identites"><span class="type-signature">(async) </span>new_identites<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  826. <dl class="details">
  827. <dt class="tag-source">Source:</dt>
  828. <dd class="tag-source"><ul class="dummy"><li>
  829. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line572">line 572</a>
  830. </li></ul></dd>
  831. </dl>
  832. <div class="description">
  833. Gets new identities for all instances in the pool.
  834. </div>
  835. <h5>Returns:</h5>
  836. <div class="param-desc">
  837. - Resolves when all instances have new identities.
  838. </div>
  839. <dl class="param-type">
  840. <dt>
  841. Type
  842. </dt>
  843. <dd>
  844. <span class="param-type">Promise</span>
  845. </dd>
  846. </dl>
  847. <h4 class="name" id="new_identites_by_group"><span class="type-signature">(async) </span>new_identites_by_group<span class="signature">(group)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  848. <dl class="details">
  849. <dt class="tag-source">Source:</dt>
  850. <dd class="tag-source"><ul class="dummy"><li>
  851. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line583">line 583</a>
  852. </li></ul></dd>
  853. </dl>
  854. <div class="description">
  855. Gets new identities for all instances in a group.
  856. </div>
  857. <h5>Parameters:</h5>
  858. <table class="params">
  859. <thead>
  860. <tr>
  861. <th>Name</th>
  862. <th>Type</th>
  863. <th class="last">Description</th>
  864. </tr>
  865. </thead>
  866. <tbody>
  867. <tr>
  868. <td class="name"><code>group</code></td>
  869. <td class="type">
  870. <span class="param-type">string</span>
  871. </td>
  872. <td class="description last">Name of the group.</td>
  873. </tr>
  874. </tbody>
  875. </table>
  876. <h5>Returns:</h5>
  877. <div class="param-desc">
  878. - Resolves when all instances in the group have new identities.
  879. </div>
  880. <dl class="param-type">
  881. <dt>
  882. Type
  883. </dt>
  884. <dd>
  885. <span class="param-type">Promise</span>
  886. </dd>
  887. </dl>
  888. <h4 class="name" id="new_identity_at"><span class="type-signature">(async) </span>new_identity_at<span class="signature">(index)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  889. <dl class="details">
  890. <dt class="tag-source">Source:</dt>
  891. <dd class="tag-source"><ul class="dummy"><li>
  892. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line594">line 594</a>
  893. </li></ul></dd>
  894. </dl>
  895. <div class="description">
  896. Gets a new identity for the instance at the provided index in the pool.
  897. </div>
  898. <h5>Parameters:</h5>
  899. <table class="params">
  900. <thead>
  901. <tr>
  902. <th>Name</th>
  903. <th>Type</th>
  904. <th class="last">Description</th>
  905. </tr>
  906. </thead>
  907. <tbody>
  908. <tr>
  909. <td class="name"><code>index</code></td>
  910. <td class="type">
  911. <span class="param-type">number</span>
  912. </td>
  913. <td class="description last">Index of the instance in the pool.</td>
  914. </tr>
  915. </tbody>
  916. </table>
  917. <h5>Returns:</h5>
  918. <div class="param-desc">
  919. - Resolves when the instance has a new identity.
  920. </div>
  921. <dl class="param-type">
  922. <dt>
  923. Type
  924. </dt>
  925. <dd>
  926. <span class="param-type">Promise</span>
  927. </dd>
  928. </dl>
  929. <h4 class="name" id="new_identity_by_name"><span class="type-signature">(async) </span>new_identity_by_name<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  930. <dl class="details">
  931. <dt class="tag-source">Source:</dt>
  932. <dd class="tag-source"><ul class="dummy"><li>
  933. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line607">line 607</a>
  934. </li></ul></dd>
  935. </dl>
  936. <div class="description">
  937. Gets a new identity for the instance whose TorProcess.instance_name matches the provided name.
  938. </div>
  939. <h5>Parameters:</h5>
  940. <table class="params">
  941. <thead>
  942. <tr>
  943. <th>Name</th>
  944. <th>Type</th>
  945. <th class="last">Description</th>
  946. </tr>
  947. </thead>
  948. <tbody>
  949. <tr>
  950. <td class="name"><code>name</code></td>
  951. <td class="type">
  952. <span class="param-type">string</span>
  953. </td>
  954. <td class="description last">Name of the instance.</td>
  955. </tr>
  956. </tbody>
  957. </table>
  958. <h5>Throws:</h5>
  959. <div class="param-desc">
  960. When no instance matched the provided name.
  961. </div>
  962. <h5>Returns:</h5>
  963. <div class="param-desc">
  964. - Resolves when the instance has a new identity.
  965. </div>
  966. <dl class="param-type">
  967. <dt>
  968. Type
  969. </dt>
  970. <dd>
  971. <span class="param-type">Promise</span>
  972. </dd>
  973. </dl>
  974. <h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="TorProcess.html">TorProcess</a>}</span></h4>
  975. <dl class="details">
  976. <dt class="tag-source">Source:</dt>
  977. <dd class="tag-source"><ul class="dummy"><li>
  978. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line536">line 536</a>
  979. </li></ul></dd>
  980. </dl>
  981. <div class="description">
  982. Runs the load balance function (<a href="TorPool.html#load_balance_method">TorPool#load_balance_method</a>) on the array of instances in the pool and returns the first instance in the array.
  983. </div>
  984. <h5>Returns:</h5>
  985. <div class="param-desc">
  986. - The first instance in the modified array.
  987. </div>
  988. <dl class="param-type">
  989. <dt>
  990. Type
  991. </dt>
  992. <dd>
  993. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  994. </dd>
  995. </dl>
  996. <h4 class="name" id="next_by_group"><span class="type-signature"></span>next_by_group<span class="signature">(group)</span><span class="type-signature"> &rarr; {<a href="TorProcess.html">TorProcess</a>}</span></h4>
  997. <dl class="details">
  998. <dt class="tag-source">Source:</dt>
  999. <dd class="tag-source"><ul class="dummy"><li>
  1000. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line549">line 549</a>
  1001. </li></ul></dd>
  1002. <dt class="tag-todo">To Do:</dt>
  1003. <dd class="tag-todo">
  1004. <ul>
  1005. <li>Load balance methods other than "round_robin" to be used</li>
  1006. </ul>
  1007. </dd>
  1008. </dl>
  1009. <div class="description">
  1010. Rotates the array containing instances in the group provided so that the second element becomes the first element and the first element becomes the last element.
  1011. [1,2,3] -> [2,3,1]
  1012. </div>
  1013. <h5>Parameters:</h5>
  1014. <table class="params">
  1015. <thead>
  1016. <tr>
  1017. <th>Name</th>
  1018. <th>Type</th>
  1019. <th class="last">Description</th>
  1020. </tr>
  1021. </thead>
  1022. <tbody>
  1023. <tr>
  1024. <td class="name"><code>group</code></td>
  1025. <td class="type">
  1026. <span class="param-type">string</span>
  1027. </td>
  1028. <td class="description last">Name of the group</td>
  1029. </tr>
  1030. </tbody>
  1031. </table>
  1032. <h5>Returns:</h5>
  1033. <div class="param-desc">
  1034. - The first element in the modified array
  1035. </div>
  1036. <dl class="param-type">
  1037. <dt>
  1038. Type
  1039. </dt>
  1040. <dd>
  1041. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  1042. </dd>
  1043. </dl>
  1044. <h4 class="name" id="remove"><span class="type-signature">(async) </span>remove<span class="signature">(instances, start_at<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1045. <dl class="details">
  1046. <dt class="tag-source">Source:</dt>
  1047. <dd class="tag-source"><ul class="dummy"><li>
  1048. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line495">line 495</a>
  1049. </li></ul></dd>
  1050. </dl>
  1051. <div class="description">
  1052. Removes a number of instances from the pool and kills their Tor processes.
  1053. </div>
  1054. <h5>Parameters:</h5>
  1055. <table class="params">
  1056. <thead>
  1057. <tr>
  1058. <th>Name</th>
  1059. <th>Type</th>
  1060. <th>Attributes</th>
  1061. <th>Default</th>
  1062. <th class="last">Description</th>
  1063. </tr>
  1064. </thead>
  1065. <tbody>
  1066. <tr>
  1067. <td class="name"><code>instances</code></td>
  1068. <td class="type">
  1069. <span class="param-type">number</span>
  1070. </td>
  1071. <td class="attributes">
  1072. </td>
  1073. <td class="default">
  1074. </td>
  1075. <td class="description last">Number of instances to remove</td>
  1076. </tr>
  1077. <tr>
  1078. <td class="name"><code>start_at</code></td>
  1079. <td class="type">
  1080. <span class="param-type">number</span>
  1081. </td>
  1082. <td class="attributes">
  1083. &lt;optional><br>
  1084. </td>
  1085. <td class="default">
  1086. <code>0</code>
  1087. </td>
  1088. <td class="description last">Index to start removing from</td>
  1089. </tr>
  1090. </tbody>
  1091. </table>
  1092. <h5>Returns:</h5>
  1093. <div class="param-desc">
  1094. - Promise will resolve when the processes are dead
  1095. </div>
  1096. <dl class="param-type">
  1097. <dt>
  1098. Type
  1099. </dt>
  1100. <dd>
  1101. <span class="param-type">Promise</span>
  1102. </dd>
  1103. </dl>
  1104. <h4 class="name" id="remove_at"><span class="type-signature">(async) </span>remove_at<span class="signature">(instance_index)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1105. <dl class="details">
  1106. <dt class="tag-source">Source:</dt>
  1107. <dd class="tag-source"><ul class="dummy"><li>
  1108. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line507">line 507</a>
  1109. </li></ul></dd>
  1110. </dl>
  1111. <div class="description">
  1112. Removes an instance at the provided index and kills its Tor process.
  1113. </div>
  1114. <h5>Parameters:</h5>
  1115. <table class="params">
  1116. <thead>
  1117. <tr>
  1118. <th>Name</th>
  1119. <th>Type</th>
  1120. <th class="last">Description</th>
  1121. </tr>
  1122. </thead>
  1123. <tbody>
  1124. <tr>
  1125. <td class="name"><code>instance_index</code></td>
  1126. <td class="type">
  1127. <span class="param-type">number</span>
  1128. </td>
  1129. <td class="description last">Index of the instance to remove</td>
  1130. </tr>
  1131. </tbody>
  1132. </table>
  1133. <h5>Returns:</h5>
  1134. <div class="param-desc">
  1135. - Promise will resolve when the process is dead
  1136. </div>
  1137. <dl class="param-type">
  1138. <dt>
  1139. Type
  1140. </dt>
  1141. <dd>
  1142. <span class="param-type">Promise</span>
  1143. </dd>
  1144. </dl>
  1145. <h4 class="name" id="remove_by_name"><span class="type-signature">(async) </span>remove_by_name<span class="signature">(instance_name)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1146. <dl class="details">
  1147. <dt class="tag-source">Source:</dt>
  1148. <dd class="tag-source"><ul class="dummy"><li>
  1149. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line523">line 523</a>
  1150. </li></ul></dd>
  1151. </dl>
  1152. <div class="description">
  1153. Removes an instance whose <a href="TorProcess.html#instance_name">TorProcess#instance_name</a> property matches the provided name and kills its Tor process.
  1154. </div>
  1155. <h5>Parameters:</h5>
  1156. <table class="params">
  1157. <thead>
  1158. <tr>
  1159. <th>Name</th>
  1160. <th>Type</th>
  1161. <th class="last">Description</th>
  1162. </tr>
  1163. </thead>
  1164. <tbody>
  1165. <tr>
  1166. <td class="name"><code>instance_name</code></td>
  1167. <td class="type">
  1168. <span class="param-type">string</span>
  1169. </td>
  1170. <td class="description last">Name of the instance to remove</td>
  1171. </tr>
  1172. </tbody>
  1173. </table>
  1174. <h5>Returns:</h5>
  1175. <div class="param-desc">
  1176. - Promise will resolve when the process is dead
  1177. </div>
  1178. <dl class="param-type">
  1179. <dt>
  1180. Type
  1181. </dt>
  1182. <dd>
  1183. <span class="param-type">Promise</span>
  1184. </dd>
  1185. </dl>
  1186. <h4 class="name" id="remove_instance_from_group"><span class="type-signature"></span>remove_instance_from_group<span class="signature">(group, instance)</span><span class="type-signature"></span></h4>
  1187. <dl class="details">
  1188. <dt class="tag-source">Source:</dt>
  1189. <dd class="tag-source"><ul class="dummy"><li>
  1190. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line174">line 174</a>
  1191. </li></ul></dd>
  1192. </dl>
  1193. <div class="description">
  1194. Removes an instance from a group.
  1195. </div>
  1196. <h5>Parameters:</h5>
  1197. <table class="params">
  1198. <thead>
  1199. <tr>
  1200. <th>Name</th>
  1201. <th>Type</th>
  1202. <th class="last">Description</th>
  1203. </tr>
  1204. </thead>
  1205. <tbody>
  1206. <tr>
  1207. <td class="name"><code>group</code></td>
  1208. <td class="type">
  1209. <span class="param-type">string</span>
  1210. </td>
  1211. <td class="description last">The group to remove the instance from.</td>
  1212. </tr>
  1213. <tr>
  1214. <td class="name"><code>instance</code></td>
  1215. <td class="type">
  1216. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  1217. </td>
  1218. <td class="description last">The instance in question.</td>
  1219. </tr>
  1220. </tbody>
  1221. </table>
  1222. <h4 class="name" id="remove_instance_from_group_at"><span class="type-signature"></span>remove_instance_from_group_at<span class="signature">(group, instance_index)</span><span class="type-signature"></span></h4>
  1223. <dl class="details">
  1224. <dt class="tag-source">Source:</dt>
  1225. <dd class="tag-source"><ul class="dummy"><li>
  1226. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line202">line 202</a>
  1227. </li></ul></dd>
  1228. </dl>
  1229. <div class="description">
  1230. Removes an instance from a group by the index of the instance in the pool.
  1231. </div>
  1232. <h5>Parameters:</h5>
  1233. <table class="params">
  1234. <thead>
  1235. <tr>
  1236. <th>Name</th>
  1237. <th>Type</th>
  1238. <th class="last">Description</th>
  1239. </tr>
  1240. </thead>
  1241. <tbody>
  1242. <tr>
  1243. <td class="name"><code>group</code></td>
  1244. <td class="type">
  1245. <span class="param-type">string</span>
  1246. </td>
  1247. <td class="description last">The group to remove the instance from.</td>
  1248. </tr>
  1249. <tr>
  1250. <td class="name"><code>instance_index</code></td>
  1251. <td class="type">
  1252. <span class="param-type">number</span>
  1253. </td>
  1254. <td class="description last">The index of the instance in question.</td>
  1255. </tr>
  1256. </tbody>
  1257. </table>
  1258. <h5>Throws:</h5>
  1259. <div class="param-desc">
  1260. If an instance with the index provided does not exist.
  1261. </div>
  1262. <h4 class="name" id="remove_instance_from_group_by_name"><span class="type-signature"></span>remove_instance_from_group_by_name<span class="signature">(group, instance_name)</span><span class="type-signature"></span></h4>
  1263. <dl class="details">
  1264. <dt class="tag-source">Source:</dt>
  1265. <dd class="tag-source"><ul class="dummy"><li>
  1266. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line186">line 186</a>
  1267. </li></ul></dd>
  1268. </dl>
  1269. <div class="description">
  1270. Removes an instance from a group by the <a href="TorProcess.html#instance_name">TorProcess#instance_name</a> property on the instance.
  1271. </div>
  1272. <h5>Parameters:</h5>
  1273. <table class="params">
  1274. <thead>
  1275. <tr>
  1276. <th>Name</th>
  1277. <th>Type</th>
  1278. <th class="last">Description</th>
  1279. </tr>
  1280. </thead>
  1281. <tbody>
  1282. <tr>
  1283. <td class="name"><code>group</code></td>
  1284. <td class="type">
  1285. <span class="param-type">string</span>
  1286. </td>
  1287. <td class="description last">The group to remove the instance from.</td>
  1288. </tr>
  1289. <tr>
  1290. <td class="name"><code>instance_name</code></td>
  1291. <td class="type">
  1292. <span class="param-type">string</span>
  1293. </td>
  1294. <td class="description last">The name of the instance in question.</td>
  1295. </tr>
  1296. </tbody>
  1297. </table>
  1298. <h5>Throws:</h5>
  1299. <div class="param-desc">
  1300. If an instance with the name provided does not exist.
  1301. </div>
  1302. <h4 class="name" id="set_config_all"><span class="type-signature">(async) </span>set_config_all<span class="signature">(keyword, value)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1303. <dl class="details">
  1304. <dt class="tag-source">Source:</dt>
  1305. <dd class="tag-source"><ul class="dummy"><li>
  1306. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line713">line 713</a>
  1307. </li></ul></dd>
  1308. </dl>
  1309. <div class="description">
  1310. Set a configuration value for all instances in the pool via the control protocol.
  1311. </div>
  1312. <h5>Parameters:</h5>
  1313. <table class="params">
  1314. <thead>
  1315. <tr>
  1316. <th>Name</th>
  1317. <th>Type</th>
  1318. <th class="last">Description</th>
  1319. </tr>
  1320. </thead>
  1321. <tbody>
  1322. <tr>
  1323. <td class="name"><code>keyword</code></td>
  1324. <td class="type">
  1325. <span class="param-type">string</span>
  1326. </td>
  1327. <td class="description last">Name of the configuration property.</td>
  1328. </tr>
  1329. <tr>
  1330. <td class="name"><code>value</code></td>
  1331. <td class="type">
  1332. <span class="param-type">any</span>
  1333. </td>
  1334. <td class="description last">Value to set the configuration property to.</td>
  1335. </tr>
  1336. </tbody>
  1337. </table>
  1338. <h5>Returns:</h5>
  1339. <dl class="param-type">
  1340. <dt>
  1341. Type
  1342. </dt>
  1343. <dd>
  1344. <span class="param-type">Promise</span>
  1345. </dd>
  1346. </dl>
  1347. <h4 class="name" id="set_config_at"><span class="type-signature">(async) </span>set_config_at<span class="signature">(index, keyword, value)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1348. <dl class="details">
  1349. <dt class="tag-source">Source:</dt>
  1350. <dd class="tag-source"><ul class="dummy"><li>
  1351. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line682">line 682</a>
  1352. </li></ul></dd>
  1353. </dl>
  1354. <div class="description">
  1355. Set a configuration value for the instance at the index in the pool via the control protocol.
  1356. </div>
  1357. <h5>Parameters:</h5>
  1358. <table class="params">
  1359. <thead>
  1360. <tr>
  1361. <th>Name</th>
  1362. <th>Type</th>
  1363. <th class="last">Description</th>
  1364. </tr>
  1365. </thead>
  1366. <tbody>
  1367. <tr>
  1368. <td class="name"><code>index</code></td>
  1369. <td class="type">
  1370. <span class="param-type">number</span>
  1371. </td>
  1372. <td class="description last">Index of the instance in the pool.</td>
  1373. </tr>
  1374. <tr>
  1375. <td class="name"><code>keyword</code></td>
  1376. <td class="type">
  1377. <span class="param-type">string</span>
  1378. </td>
  1379. <td class="description last">Name of the configuration property.</td>
  1380. </tr>
  1381. <tr>
  1382. <td class="name"><code>value</code></td>
  1383. <td class="type">
  1384. <span class="param-type">any</span>
  1385. </td>
  1386. <td class="description last">Value to set the configuration property to.</td>
  1387. </tr>
  1388. </tbody>
  1389. </table>
  1390. <h5>Throws:</h5>
  1391. <div class="param-desc">
  1392. When no instance exists at the provided index.
  1393. </div>
  1394. <h5>Returns:</h5>
  1395. <dl class="param-type">
  1396. <dt>
  1397. Type
  1398. </dt>
  1399. <dd>
  1400. <span class="param-type">Promise</span>
  1401. </dd>
  1402. </dl>
  1403. <h4 class="name" id="set_config_by_group"><span class="type-signature">(async) </span>set_config_by_group<span class="signature">(group, keyword, value)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1404. <dl class="details">
  1405. <dt class="tag-source">Source:</dt>
  1406. <dd class="tag-source"><ul class="dummy"><li>
  1407. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line700">line 700</a>
  1408. </li></ul></dd>
  1409. </dl>
  1410. <div class="description">
  1411. Set a configuration value for all instances in the provided group via the control protocol.
  1412. </div>
  1413. <h5>Parameters:</h5>
  1414. <table class="params">
  1415. <thead>
  1416. <tr>
  1417. <th>Name</th>
  1418. <th>Type</th>
  1419. <th class="last">Description</th>
  1420. </tr>
  1421. </thead>
  1422. <tbody>
  1423. <tr>
  1424. <td class="name"><code>group</code></td>
  1425. <td class="type">
  1426. <span class="param-type">string</span>
  1427. </td>
  1428. <td class="description last">Name of the group.</td>
  1429. </tr>
  1430. <tr>
  1431. <td class="name"><code>keyword</code></td>
  1432. <td class="type">
  1433. <span class="param-type">string</span>
  1434. </td>
  1435. <td class="description last">Name of the configuration property.</td>
  1436. </tr>
  1437. <tr>
  1438. <td class="name"><code>value</code></td>
  1439. <td class="type">
  1440. <span class="param-type">any</span>
  1441. </td>
  1442. <td class="description last">Value to set the configuration property to.</td>
  1443. </tr>
  1444. </tbody>
  1445. </table>
  1446. <h5>Throws:</h5>
  1447. <div class="param-desc">
  1448. When the provided group does not exist.
  1449. </div>
  1450. <h5>Returns:</h5>
  1451. <dl class="param-type">
  1452. <dt>
  1453. Type
  1454. </dt>
  1455. <dd>
  1456. <span class="param-type">Promise</span>
  1457. </dd>
  1458. </dl>
  1459. <h4 class="name" id="set_config_by_name"><span class="type-signature">(async) </span>set_config_by_name<span class="signature">(name, keyword, value)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1460. <dl class="details">
  1461. <dt class="tag-source">Source:</dt>
  1462. <dd class="tag-source"><ul class="dummy"><li>
  1463. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line645">line 645</a>
  1464. </li></ul></dd>
  1465. </dl>
  1466. <div class="description">
  1467. Set a configuration value for the instance whose TorProcess.instance_name matches the provided name via the control protocol.
  1468. </div>
  1469. <h5>Parameters:</h5>
  1470. <table class="params">
  1471. <thead>
  1472. <tr>
  1473. <th>Name</th>
  1474. <th>Type</th>
  1475. <th class="last">Description</th>
  1476. </tr>
  1477. </thead>
  1478. <tbody>
  1479. <tr>
  1480. <td class="name"><code>name</code></td>
  1481. <td class="type">
  1482. <span class="param-type">string</span>
  1483. </td>
  1484. <td class="description last">Name of the instance.</td>
  1485. </tr>
  1486. <tr>
  1487. <td class="name"><code>keyword</code></td>
  1488. <td class="type">
  1489. <span class="param-type">string</span>
  1490. </td>
  1491. <td class="description last">Name of the configuration property.</td>
  1492. </tr>
  1493. <tr>
  1494. <td class="name"><code>value</code></td>
  1495. <td class="type">
  1496. <span class="param-type">any</span>
  1497. </td>
  1498. <td class="description last">Value to set the configuration property to.</td>
  1499. </tr>
  1500. </tbody>
  1501. </table>
  1502. <h5>Throws:</h5>
  1503. <div class="param-desc">
  1504. When no instance matched the provided name.
  1505. </div>
  1506. <h5>Returns:</h5>
  1507. <dl class="param-type">
  1508. <dt>
  1509. Type
  1510. </dt>
  1511. <dd>
  1512. <span class="param-type">Promise</span>
  1513. </dd>
  1514. </dl>
  1515. <h4 class="name" id="signal_all"><span class="type-signature">(async) </span>signal_all<span class="signature">(signal)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1516. <dl class="details">
  1517. <dt class="tag-source">Source:</dt>
  1518. <dd class="tag-source"><ul class="dummy"><li>
  1519. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line725">line 725</a>
  1520. </li></ul></dd>
  1521. </dl>
  1522. <div class="description">
  1523. Send a signal via the control protocol to all instances in the pool.
  1524. </div>
  1525. <h5>Parameters:</h5>
  1526. <table class="params">
  1527. <thead>
  1528. <tr>
  1529. <th>Name</th>
  1530. <th>Type</th>
  1531. <th class="last">Description</th>
  1532. </tr>
  1533. </thead>
  1534. <tbody>
  1535. <tr>
  1536. <td class="name"><code>signal</code></td>
  1537. <td class="type">
  1538. <span class="param-type">string</span>
  1539. </td>
  1540. <td class="description last">The signal to send.</td>
  1541. </tr>
  1542. </tbody>
  1543. </table>
  1544. <h5>Returns:</h5>
  1545. <dl class="param-type">
  1546. <dt>
  1547. Type
  1548. </dt>
  1549. <dd>
  1550. <span class="param-type">Promise</span>
  1551. </dd>
  1552. </dl>
  1553. <h4 class="name" id="signal_at"><span class="type-signature">(async) </span>signal_at<span class="signature">(index, signal)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1554. <dl class="details">
  1555. <dt class="tag-source">Source:</dt>
  1556. <dd class="tag-source"><ul class="dummy"><li>
  1557. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line755">line 755</a>
  1558. </li></ul></dd>
  1559. </dl>
  1560. <div class="description">
  1561. Send a signal via the control protocol to an instance at the provided index in the pool.
  1562. </div>
  1563. <h5>Parameters:</h5>
  1564. <table class="params">
  1565. <thead>
  1566. <tr>
  1567. <th>Name</th>
  1568. <th>Type</th>
  1569. <th class="last">Description</th>
  1570. </tr>
  1571. </thead>
  1572. <tbody>
  1573. <tr>
  1574. <td class="name"><code>index</code></td>
  1575. <td class="type">
  1576. <span class="param-type">number</span>
  1577. </td>
  1578. <td class="description last">Index of the instance in the pool.</td>
  1579. </tr>
  1580. <tr>
  1581. <td class="name"><code>signal</code></td>
  1582. <td class="type">
  1583. <span class="param-type">string</span>
  1584. </td>
  1585. <td class="description last">The signal to send.</td>
  1586. </tr>
  1587. </tbody>
  1588. </table>
  1589. <h5>Returns:</h5>
  1590. <dl class="param-type">
  1591. <dt>
  1592. Type
  1593. </dt>
  1594. <dd>
  1595. <span class="param-type">Promise</span>
  1596. </dd>
  1597. </dl>
  1598. <h4 class="name" id="signal_by_group"><span class="type-signature">(async) </span>signal_by_group<span class="signature">(group, signal)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1599. <dl class="details">
  1600. <dt class="tag-source">Source:</dt>
  1601. <dd class="tag-source"><ul class="dummy"><li>
  1602. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line773">line 773</a>
  1603. </li></ul></dd>
  1604. </dl>
  1605. <div class="description">
  1606. Send a signal via the control protocol to all instances in the provided group.
  1607. </div>
  1608. <h5>Parameters:</h5>
  1609. <table class="params">
  1610. <thead>
  1611. <tr>
  1612. <th>Name</th>
  1613. <th>Type</th>
  1614. <th class="last">Description</th>
  1615. </tr>
  1616. </thead>
  1617. <tbody>
  1618. <tr>
  1619. <td class="name"><code>group</code></td>
  1620. <td class="type">
  1621. <span class="param-type">string</span>
  1622. </td>
  1623. <td class="description last">Name of the group.</td>
  1624. </tr>
  1625. <tr>
  1626. <td class="name"><code>signal</code></td>
  1627. <td class="type">
  1628. <span class="param-type">string</span>
  1629. </td>
  1630. <td class="description last">The signal to send.</td>
  1631. </tr>
  1632. </tbody>
  1633. </table>
  1634. <h5>Throws:</h5>
  1635. <div class="param-desc">
  1636. When the provided group does not exist.
  1637. </div>
  1638. <h5>Returns:</h5>
  1639. <dl class="param-type">
  1640. <dt>
  1641. Type
  1642. </dt>
  1643. <dd>
  1644. <span class="param-type">Promise</span>
  1645. </dd>
  1646. </dl>
  1647. <h4 class="name" id="signal_by_name"><span class="type-signature">(async) </span>signal_by_name<span class="signature">(name, signal)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
  1648. <dl class="details">
  1649. <dt class="tag-source">Source:</dt>
  1650. <dd class="tag-source"><ul class="dummy"><li>
  1651. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line738">line 738</a>
  1652. </li></ul></dd>
  1653. </dl>
  1654. <div class="description">
  1655. Send a signal via the control protocol to an instance whose <a href="TorProcess.html#instance_name">TorProcess#instance_name</a> property matches the provided name.
  1656. </div>
  1657. <h5>Parameters:</h5>
  1658. <table class="params">
  1659. <thead>
  1660. <tr>
  1661. <th>Name</th>
  1662. <th>Type</th>
  1663. <th class="last">Description</th>
  1664. </tr>
  1665. </thead>
  1666. <tbody>
  1667. <tr>
  1668. <td class="name"><code>name</code></td>
  1669. <td class="type">
  1670. <span class="param-type">string</span>
  1671. </td>
  1672. <td class="description last">Name of the instance.</td>
  1673. </tr>
  1674. <tr>
  1675. <td class="name"><code>signal</code></td>
  1676. <td class="type">
  1677. <span class="param-type">string</span>
  1678. </td>
  1679. <td class="description last">The signal to send.</td>
  1680. </tr>
  1681. </tbody>
  1682. </table>
  1683. <h5>Returns:</h5>
  1684. <dl class="param-type">
  1685. <dt>
  1686. Type
  1687. </dt>
  1688. <dd>
  1689. <span class="param-type">Promise</span>
  1690. </dd>
  1691. </dl>
  1692. <h3 class="subsection-title">Events</h3>
  1693. <h4 class="name" id="event:instance_created">instance_created</h4>
  1694. <dl class="details">
  1695. <dt class="tag-source">Source:</dt>
  1696. <dd class="tag-source"><ul class="dummy"><li>
  1697. <a href="TorPool.js.html">TorPool.js</a>, <a href="TorPool.js.html#line422">line 422</a>
  1698. </li></ul></dd>
  1699. </dl>
  1700. <div class="description">
  1701. Fires when an instance has been created.
  1702. </div>
  1703. <h5>Type:</h5>
  1704. <ul>
  1705. <li>
  1706. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  1707. </li>
  1708. </ul>
  1709. <h5>Parameters:</h5>
  1710. <table class="params">
  1711. <thead>
  1712. <tr>
  1713. <th>Name</th>
  1714. <th>Type</th>
  1715. <th class="last">Description</th>
  1716. </tr>
  1717. </thead>
  1718. <tbody>
  1719. <tr>
  1720. <td class="name"><code>instance</code></td>
  1721. <td class="type">
  1722. <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
  1723. </td>
  1724. <td class="description last">The instance that was created.</td>
  1725. </tr>
  1726. </tbody>
  1727. </table>
  1728. </article>
  1729. </section>
  1730. </div>
  1731. <br class="clear">
  1732. <footer>
  1733. 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.
  1734. </footer>
  1735. <script>prettyPrint();</script>
  1736. <script src="scripts/linenumber.js"></script>
  1737. </body>
  1738. </html>