Files
metasploit-gs/api/Rex/Proto/Http/ServerClient.html
T

568 lines
13 KiB
HTML
Raw Normal View History

2026-05-08 17:08:43 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Rex::Proto::Http::ServerClient
&mdash; Documentation by YARD 0.9.37
</title>
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Rex::Proto::Http::ServerClient";
relpath = '../../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../../_index.html">Index (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../../Rex.html" title="Rex (module)">Rex</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Proto.html" title="Rex::Proto (module)">Proto</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Http.html" title="Rex::Proto::Http (module)">Http</a></span></span>
&raquo;
<span class="title">ServerClient</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Module: Rex::Proto::Http::ServerClient
</h1>
<div class="box_info">
<dl>
<dt>Defined in:</dt>
<dd>lib/rex/proto/http/server_client.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Runtime extension of the HTTP clients that connect to the server.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#keepalive-instance_method" title="#keepalive (instance method)">#<strong>keepalive</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Boolean that indicates whether or not the connection supports keep-alive.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#request-instance_method" title="#request (instance method)">#<strong>request</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The current request context.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#server-instance_method" title="#server (instance method)">#<strong>server</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>A reference to the server the client is associated with.</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#init_cli-instance_method" title="#init_cli (instance method)">#<strong>init_cli</strong>(server) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Initialize a new request instance.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reset_cli-instance_method" title="#reset_cli (instance method)">#<strong>reset_cli</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Resets the parsing state.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#send_response-instance_method" title="#send_response (instance method)">#<strong>send_response</strong>(response) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Transmits a response and adds the appropriate headers.</p>
</div></span>
</li>
</ul>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="keepalive=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="keepalive-instance_method">
#<strong>keepalive</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Boolean that indicates whether or not the connection supports keep-alive.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
54
55
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 54</span>
<span class='kw'>def</span> <span class='id identifier rubyid_keepalive'>keepalive</span>
<span class='ivar'>@keepalive</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="request=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="request-instance_method">
#<strong>request</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current request context.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span>
<span class='ivar'>@request</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="server=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="server-instance_method">
#<strong>server</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>A reference to the server the client is associated with.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 58</span>
<span class='kw'>def</span> <span class='id identifier rubyid_server'>server</span>
<span class='ivar'>@server</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="init_cli-instance_method">
#<strong>init_cli</strong>(server) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Initialize a new request instance.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20
21
22
23</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_init_cli'>init_cli</span><span class='lparen'>(</span><span class='id identifier rubyid_server'>server</span><span class='rparen'>)</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Request.html" title="Rex::Proto::Http::Request (class)">Request</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Request.html#initialize-instance_method" title="Rex::Proto::Http::Request#initialize (method)">new</a></span></span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='id identifier rubyid_server'>server</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_keepalive'>keepalive</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reset_cli-instance_method">
#<strong>reset_cli</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Resets the parsing state.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
28
29
30</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 28</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reset_cli'>reset_cli</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="send_response-instance_method">
#<strong>send_response</strong>(response) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Transmits a response and adds the appropriate headers.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
35
36
37
38
39
40
41
42
43
44
45</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/http/server_client.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_send_response'>send_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='comment'># Set the connection to close or keep-alive depending on what the client
</span> <span class='comment'># can support.
</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Connection</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_keepalive'>keepalive</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Keep-Alive</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>close</span><span class='tstring_end'>&#39;</span></span>
<span class='comment'># Add any other standard response headers.
</span> <span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_add_response_headers'>add_response_headers</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='comment'># Send it off.
</span> <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:03:10 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.37 (ruby-3.1.5).
</div>
</div>
</body>
</html>