2018-09-19 15:22:17 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > HTTPServer - 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
< / nav >
< div id = "main" >
< h1 class = "page-title" > HTTPServer< / h1 >
< section >
< header >
< h2 >
HTTPServer
< / h2 >
< div class = "class-description" > A HTTP(S) 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 = "HTTPServer" > < span class = "type-signature" > < / span > new HTTPServer< 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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line28" > line 28< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Creates an instance of `HTTPServer`.
< / 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 (http://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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line321" > line 321< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Winston logger.
< / 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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line333" > line 333< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Configuration for "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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line327" > line 327< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
The pool of instances that will be used for 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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line38" > line 38< / 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" > 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 = "HTTPServer.js.html" > HTTPServer.js< / a > , < a href = "HTTPServer.js.html#line181" > line 181< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Fires when the proxy has made a connection through an instance using HTTP or HTTP-Connect.
< / 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 >
2018-09-25 16:53:29 +00:00
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.
2018-09-19 15:22:17 +00:00
< / footer >
< script > prettyPrint ( ) ; < / script >
< script src = "scripts/linenumber.js" > < / script >
< / body >
< / html >