12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
-
- <meta charset="utf-8">
- <title>SOCKSServer - Documentation</title>
-
-
- <script src="scripts/prettify/prettify.js"></script>
- <script src="scripts/prettify/lang-css.js"></script>
- <!--[if lt IE 9]>
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- <link type="text/css" rel="stylesheet" href="styles/prettify.css">
- <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <input type="checkbox" id="nav-trigger" class="nav-trigger" />
- <label for="nav-trigger" class="navicon-button x">
- <div class="navicon"></div>
- </label>
- <label for="nav-trigger" class="overlay"></label>
- <nav>
-
- <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>
- </nav>
- <div id="main">
-
- <h1 class="page-title">SOCKSServer</h1>
-
-
- <section>
- <header>
-
- <h2>
- SOCKSServer
- </h2>
-
- <div class="class-description">A SOCKS5 proxy server that will route requests to instances in the TorPool provided.</div>
-
-
- </header>
- <article>
-
- <div class="container-overview">
-
-
-
- <h2>Constructor</h2>
-
- <h4 class="name" id="SOCKSServer"><span class="type-signature"></span>new SOCKSServer<span class="signature">(tor_pool, logger<span class="signature-attributes">opt</span>, proxy_by_name<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
-
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line26">line 26</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Creates an instance of `SOCKSServer`.
- </div>
- <h5>Parameters:</h5>
-
- <table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
- <th>Type</th>
-
- <th>Attributes</th>
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
-
- <td class="name"><code>tor_pool</code></td>
-
- <td class="type">
-
-
- <span class="param-type"><a href="TorPool.html">TorPool</a></span>
-
- </td>
-
- <td class="attributes">
-
-
-
- </td>
-
-
- <td class="description last">The pool of instances that will be used for requests</td>
- </tr>
-
- <tr>
-
- <td class="name"><code>logger</code></td>
-
- <td class="type">
-
-
- <span class="param-type">Logger</span>
-
- </td>
-
- <td class="attributes">
-
- <optional><br>
-
-
-
- </td>
-
-
- <td class="description last">Winston logger that will be used for logging. If not specified will disable logging.</td>
- </tr>
-
- <tr>
-
- <td class="name"><code>proxy_by_name</code></td>
-
- <td class="type">
-
-
- <span class="param-type"><a href="global.html#ProxyByNameConfig">ProxyByNameConfig</a></span>
-
- </td>
-
- <td class="attributes">
-
- <optional><br>
-
-
-
- </td>
-
-
- <td class="description last">Enable routing to specific instances or groups of instances using the username field (socks://instance-1:@my-server:9050) when connecting.</td>
- </tr>
-
- </tbody>
- </table>
-
- </div>
-
-
- <h3 class="subsection-title">Extends</h3>
-
- <ul>
- <li>Server</li>
- </ul>
-
-
-
-
-
-
- <h3 class="subsection-title">Members</h3>
-
-
- <h4 class="name" id="logger"><span class="type-signature"></span>logger<span class="type-signature"> :Logger</span></h4>
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line219">line 219</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Winston logger to use.
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
-
- <span class="param-type">Logger</span>
- </li>
- </ul>
-
-
- <h4 class="name" id="proxy_by_name"><span class="type-signature"></span>proxy_by_name<span class="type-signature"> :<a href="global.html#ProxyByNameConfig">ProxyByNameConfig</a></span></h4>
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line233">line 233</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Configuration for the "proxy by name" feature.
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
-
- <span class="param-type"><a href="global.html#ProxyByNameConfig">ProxyByNameConfig</a></span>
- </li>
- </ul>
-
-
- <h4 class="name" id="tor_pool"><span class="type-signature"></span>tor_pool<span class="type-signature"> :<a href="TorPool.html">TorPool</a></span></h4>
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line226">line 226</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Pool of instances use to service requests.
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
-
- <span class="param-type"><a href="TorPool.html">TorPool</a></span>
- </li>
- </ul>
-
-
-
- <h3 class="subsection-title">Methods</h3>
-
-
-
- <h4 class="name" id="listen"><span class="type-signature">(async) </span>listen<span class="signature">(port, host<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise}</span></h4>
-
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line43">line 43</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Binds the server to a port and IP Address.
- </div>
- <h5>Parameters:</h5>
-
- <table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
- <th>Type</th>
-
- <th>Attributes</th>
-
-
- <th>Default</th>
-
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
-
- <td class="name"><code>port</code></td>
-
- <td class="type">
-
-
- <span class="param-type">number</span>
-
- </td>
-
- <td class="attributes">
-
-
-
- </td>
-
-
- <td class="default">
-
- </td>
-
- <td class="description last">The port to bind to.</td>
- </tr>
-
- <tr>
-
- <td class="name"><code>host</code></td>
-
- <td class="type">
-
-
- <span class="param-type">string</span>
-
- </td>
-
- <td class="attributes">
-
- <optional><br>
-
-
-
- </td>
-
-
- <td class="default">
-
- <code>"::"</code>
-
- </td>
-
- <td class="description last">Address to bind to. Will default to :: or 0.0.0.0 if not specified.</td>
- </tr>
-
- </tbody>
- </table>
- <h5>Returns:</h5>
-
- <dl class="param-type">
- <dt>
- Type
- </dt>
- <dd>
-
- <span class="param-type">Promise</span>
- </dd>
- </dl>
-
-
-
-
- <h3 class="subsection-title">Type Definitions</h3>
-
-
-
- <h4 class="name" id="~authenticate_user_callback"><span class="type-signature"></span>authenticate_user_callback<span class="signature">(allow, user)</span><span class="type-signature"></span></h4>
-
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line27">line 27</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Callback for `authenticate_user`.
- </div>
- <h5>Parameters:</h5>
-
- <table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
- <th>Type</th>
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
-
- <td class="name"><code>allow</code></td>
-
- <td class="type">
-
-
- <span class="param-type">boolean</span>
-
- </td>
-
-
- <td class="description last">Indicates if the connection should be allowed.</td>
- </tr>
-
- <tr>
-
- <td class="name"><code>user</code></td>
-
- <td class="type">
-
-
- <span class="param-type">boolean</span>
-
- </td>
-
-
- <td class="description last">Indicates if the connection should have a session (authentication was successful).</td>
- </tr>
-
- </tbody>
- </table>
-
-
-
- <h3 class="subsection-title">Events</h3>
-
-
-
- <h4 class="name" id="event:instance-connection">instance-connection</h4>
-
- <dl class="details">
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="SOCKSServer.js.html">SOCKSServer.js</a>, <a href="SOCKSServer.js.html#line157">line 157</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </dl>
- <div class="description">
- Fires when the proxy has made a connection through an instance.
- </div>
- <h5>Parameters:</h5>
-
- <table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
- <th>Type</th>
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
-
- <td class="name"><code>instance</code></td>
-
- <td class="type">
-
-
- <span class="param-type"><a href="TorProcess.html">TorProcess</a></span>
-
- </td>
-
-
- <td class="description last">Instance that has been connected to.</td>
- </tr>
-
- <tr>
-
- <td class="name"><code>source</code></td>
-
- <td class="type">
-
-
- <span class="param-type"><a href="global.html#InstanceConnectionSource">InstanceConnectionSource</a></span>
-
- </td>
-
-
- <td class="description last">Details on the source of the connection.</td>
- </tr>
-
- </tbody>
- </table>
-
-
- </article>
- </section>
-
-
- </div>
- <br class="clear">
- <footer>
- 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.
- </footer>
- <script>prettyPrint();</script>
- <script src="scripts/linenumber.js"></script>
- </body>
- </html>
|