<h1>pappyproxy package<aclass="headerlink"href="#pappyproxy-package"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="subpackages">
<h2>Subpackages<aclass="headerlink"href="#subpackages"title="Permalink to this headline">¶</a></h2>
<divclass="toctree-wrapper compound">
<ulclass="simple">
</ul>
</div>
</div>
<divclass="section"id="submodules">
<h2>Submodules<aclass="headerlink"href="#submodules"title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section"id="module-pappyproxy.comm">
<spanid="pappyproxy-comm-module"></span><h2>pappyproxy.comm module<aclass="headerlink"href="#module-pappyproxy.comm"title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section"id="module-pappyproxy.config">
<spanid="pappyproxy-config-module"></span><h2>pappyproxy.config module<aclass="headerlink"href="#module-pappyproxy.config"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="descclassname">pappyproxy.config.</code><codeclass="descname">PappyConfig</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">pappy_dir</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.pappy_dir"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The file where pappy’s scripts are located. Don’t write anything here, and you
it’s run are put. For example, plugins are stored in <codeclass="docutils literal"><spanclass="pre">{DATADIR}/plugins</span></code> and
certs are by default stored in <codeclass="docutils literal"><spanclass="pre">{DATADIR}/certs</span></code>. This defaults to <codeclass="docutils literal"><spanclass="pre">~/.pappy</span></code>
<codeclass="descname">debug_dir</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.debug_dir"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The directory to write debug output to. Don’t put this outside the project folder
<codeclass="descname">listeners</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.listeners"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The list of active listeners. It is a list of tuples of the format (port, interface)
Not modifiable after startup. Configured in the <codeclass="docutils literal"><spanclass="pre">config.json</span></code> file for the project.</p>
<codeclass="descname">socks_proxy</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.socks_proxy"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Details for a SOCKS proxy. It is a dict with the following key/values:</p>
<divclass="highlight-python"><divclass="highlight"><pre><span></span>host: The SOCKS proxy host
<codeclass="descname">http_proxy</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.http_proxy"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Details for an upstream HTTP proxy. It is a dict with the following key/values:</p>
<divclass="highlight-python"><divclass="highlight"><pre><span></span>host: The proxy host
<codeclass="descname">plugin_dirs</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.plugin_dirs"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>List of directories that plugins are loaded from. Not modifiable.</p>
<codeclass="descname">save_history</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.save_history"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Whether command history should be saved to a file/loaded at startup.</p>
<codeclass="descname">config_dict</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.config_dict"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The dictionary read from config.json. When writing plugins, use this to load
<codeclass="descname">global_config_dict</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.global_config_dict"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The dictionary from ~/.pappy/global_config.json. It contains settings for
Pappy that are specific to the current computer. Avoid putting settings here,
especially if it involves specific projects.</p>
<dlclass="data">
<dtid="pappyproxy.config.PappyConfig.archive">
<codeclass="descname">archive</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.archive"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Project archive compressed as a <codeclass="docutils literal"><spanclass="pre">tar.bz2</span></code> archive if libraries available on the system,
<codeclass="descname">crypt_dir</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.crypt_dir"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Temporary working directory to unpack an encrypted project archive. Directory
will contain copies of normal startup files, e.g. conifg.json, cmdhistory, etc.
On exiting pappy, entire directory will be compressed into an archive and encrypted.
Compressed as a tar.bz2 archive if libraries available on the system,
<codeclass="descname">crypt_file</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.crypt_file"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Encrypted archive of the temporary working directory <codeclass="docutils literal"><spanclass="pre">crypt_dir</span></code>. Compressed as a
tar.bz2 archive if libraries available on the system, otherwise falls back to zip.</p>
<codeclass="descname">crypt_session</code><aclass="headerlink"href="#pappyproxy.config.PappyConfig.crypt_session"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>Boolean variable to determine whether pappy started in crypto mode</p>
<spanid="pappyproxy-console-module"></span><h2>pappyproxy.console module<aclass="headerlink"href="#module-pappyproxy.console"title="Permalink to this headline">¶</a></h2>
<p>Contains helpers for interacting with the console. Includes definition for the
class that is used to run the console.</p>
<dlclass="class">
<dtid="pappyproxy.console.ProxyCmd">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.console.</code><codeclass="descname">ProxyCmd</code><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.console.ProxyCmd"title="Permalink to this definition">¶</a></dt>
<p>An object representing the console interface. Provides methods to add
commands and aliases to the console.</p>
<dlclass="method">
<dtid="pappyproxy.console.ProxyCmd.add_alias">
<codeclass="descname">add_alias</code><spanclass="sig-paren">(</span><em>command</em>, <em>alias</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.console.ProxyCmd.add_alias"title="Permalink to this definition">¶</a></dt>
<dd><p>Add an alias for a command.
ie add_alias(“foo”, “f”) will let you run the ‘foo’ command with ‘f’</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.console.ProxyCmd.add_aliases">
<codeclass="descname">add_aliases</code><spanclass="sig-paren">(</span><em>alias_list</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.console.ProxyCmd.add_aliases"title="Permalink to this definition">¶</a></dt>
<dd><p>Pass in a list of tuples to add them all as aliases.
ie add_aliases([(‘foo’, ‘f’), (‘foo’, ‘fo’)]) will add ‘f’ and ‘fo’ as
aliases for ‘foo’</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.console.ProxyCmd.set_cmd">
<codeclass="descname">set_cmd</code><spanclass="sig-paren">(</span><em>command</em>, <em>func</em>, <em>autocomplete_func=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.console.ProxyCmd.set_cmd"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a command to the console.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.console.ProxyCmd.set_cmds">
<codeclass="descname">set_cmds</code><spanclass="sig-paren">(</span><em>cmd_dict</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.console.ProxyCmd.set_cmds"title="Permalink to this definition">¶</a></dt>
<dd><p>Set multiple commands from a dictionary. Format is:
<spanid="pappyproxy-context-module"></span><h2>pappyproxy.context module<aclass="headerlink"href="#module-pappyproxy.context"title="Permalink to this headline">¶</a></h2>
<dlclass="class">
<dtid="pappyproxy.context.Context">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.context.</code><codeclass="descname">Context</code><aclass="headerlink"href="#pappyproxy.context.Context"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Variables:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>active_filters</strong> (List of functions that takes one <aclass="reference internal"href="#pappyproxy.http.Request"title="pappyproxy.http.Request"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.http.Request</span></code></a> and returns either true or false.) – Filters that are currently applied to the context</li>
<li><strong>active_requests</strong>– Requests which pass all the filters applied to the context</li>
<li><strong>inactive_requests</strong>– Requests which do not pass all the filters applied to the context</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="pappyproxy.context.Context.add_filter">
<codeclass="descname">add_filter</code><spanclass="sig-paren">(</span><em>filt</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.Context.add_filter"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a filter to the context. This will remove any requests that do not pass
the filter from the <codeclass="docutils literal"><spanclass="pre">active_requests</span></code> set.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>filt</strong> (Function that takes one <aclass="reference internal"href="#pappyproxy.http.Request"title="pappyproxy.http.Request"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.http.Request</span></code></a> and returns either true or false. (or a <aclass="reference internal"href="#pappyproxy.context.Filter"title="pappyproxy.context.Filter"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.context.Filter</span></code></a>)) – The filter to add</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.context.Context.filter_up">
<codeclass="descname">filter_up</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.Context.filter_up"title="Permalink to this definition">¶</a></dt>
<dd><p>Removes the last filter that was applied to the context.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.context.Context.set_filters">
<codeclass="descname">set_filters</code><spanclass="sig-paren">(</span><em>filters</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.Context.set_filters"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the list of filters for the context.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pappyproxy.context.Filter">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.context.</code><codeclass="descname">Filter</code><spanclass="sig-paren">(</span><em>filter_string</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.Filter"title="Permalink to this definition">¶</a></dt>
<p>A class representing a filter. Its claim to fame is that you can use
<aclass="reference internal"href="#pappyproxy.context.Filter.from_filter_string"title="pappyproxy.context.Filter.from_filter_string"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.context.Filter.from_filter_string()</span></code></a> to generate a
<emclass="property">static </em><codeclass="descname">from_filter_string</code><spanclass="sig-paren">(</span><em>filter_string</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.Filter.from_filter_string"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Return type:</th><tdclass="field-body">Deferred that returns a <aclass="reference internal"href="#pappyproxy.context.Filter"title="pappyproxy.context.Filter"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.context.Filter</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.context.async_set_tag">
<codeclass="descclassname">pappyproxy.context.</code><codeclass="descname">async_set_tag</code><spanclass="sig-paren">(</span><em>tag</em>, <em>reqs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.async_set_tag"title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the tag from every request then add the given requests to memory and
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tag</strong> (<em>String</em>) – The tag to set</li>
<li><strong>reqs</strong> (<em>List of Requests</em>) – The requests to assign to the tag</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.context.set_tag">
<codeclass="descclassname">pappyproxy.context.</code><codeclass="descname">set_tag</code><spanclass="sig-paren">(</span><em>tag</em>, <em>reqs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.context.set_tag"title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the tag from every request then add the given requests to memory and
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tag</strong> (<em>String</em>) – The tag to set</li>
<li><strong>reqs</strong> (<em>List of Requests</em>) – The requests to assign to the tag</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<divclass="section"id="module-pappyproxy.http">
<spanid="pappyproxy-http-module"></span><h2>pappyproxy.http module<aclass="headerlink"href="#module-pappyproxy.http"title="Permalink to this headline">¶</a></h2>
<dlclass="class">
<dtid="pappyproxy.http.HTTPMessage">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">HTTPMessage</code><spanclass="sig-paren">(</span><em>full_message=None</em>, <em>update_content_length=False</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Variables:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>complete</strong> (<aclass="reference internal"href="#pappyproxy.http.RepeatableDict"title="pappyproxy.http.RepeatableDict"><em>RepeatableDict</em></a>) – When loading data with
<aclass="reference internal"href="#pappyproxy.http.HTTPMessage.add_line"title="pappyproxy.http.HTTPMessage.add_line"><codeclass="xref py py-func docutils literal"><spanclass="pre">add_line()</span></code></a> and
<aclass="reference internal"href="#pappyproxy.http.HTTPMessage.add_data"title="pappyproxy.http.HTTPMessage.add_data"><codeclass="xref py py-func docutils literal"><spanclass="pre">add_data()</span></code></a>, returns whether the message
is complete</li>
<li><strong>headers</strong>– Headers of the message</li>
<li><strong>headers_complete</strong>– When creating the message with
<aclass="reference internal"href="#pappyproxy.http.HTTPMessage.add_line"title="pappyproxy.http.HTTPMessage.add_line"><codeclass="xref py py-func docutils literal"><spanclass="pre">add_line()</span></code></a> and
<aclass="reference internal"href="#pappyproxy.http.HTTPMessage.add_data"title="pappyproxy.http.HTTPMessage.add_data"><codeclass="xref py py-func docutils literal"><spanclass="pre">add_data()</span></code></a>, returns whether the headers
are complete</li>
<li><aclass="reference internal"href="#pappyproxy.http.Request.start_line"title="pappyproxy.http.Request.start_line"><strong>start_line</strong></a> (<aclass="reference external"href="https://docs.python.org/library/string.html#module-string"title="(in Python v2.7)"><em>string</em></a>) – The start line of the message</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="pappyproxy.http.HTTPMessage.add_data">
<codeclass="descname">add_data</code><spanclass="sig-paren">(</span><em>data</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.add_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Used for building a message from a Twisted protocol.
Add data to the message. The data must conform to the content encoding
and transfer encoding given in the headers passed in to
<aclass="reference internal"href="#pappyproxy.http.HTTPMessage.add_line"title="pappyproxy.http.HTTPMessage.add_line"><codeclass="xref py py-func docutils literal"><spanclass="pre">add_line()</span></code></a>. Can be any fragment of the data.
I do not suggest that you use this function ever.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>data</strong> (<aclass="reference external"href="https://docs.python.org/library/string.html#module-string"title="(in Python v2.7)"><em>string</em></a>) – The data to add</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.HTTPMessage.add_line">
<codeclass="descname">add_line</code><spanclass="sig-paren">(</span><em>line</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.add_line"title="Permalink to this definition">¶</a></dt>
<dd><p>Used for building a message from a Twisted protocol.
Add a line (for status line and headers). Lines must be added in order
and the first line must be the status line. The line should not contain
the trailing carriage return/newline. I do not suggest you use this for
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>line</strong> (<aclass="reference external"href="https://docs.python.org/library/string.html#module-string"title="(in Python v2.7)"><em>string</em></a>) – The line to add</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.HTTPMessage.body">
<codeclass="descname">body</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.body"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">body_pretty</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.body_pretty"title="Permalink to this definition">¶</a></dt>
<dd><p>Same thing as <codeclass="xref py py-func docutils literal"><spanclass="pre">pappy.http.HTTPMessage.body()</span></code> but the output is
<codeclass="descname">clear</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.clear"title="Permalink to this definition">¶</a></dt>
<dd><p>Resets all internal data and clears the message</p>
<codeclass="descname">copy</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.copy"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">from_json</code><spanclass="sig-paren">(</span><em>json_string</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.from_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Update the metadata of the message to match data from
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>json_string</strong> (<em>JSON data in a string</em>) – The JSON data to use</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.HTTPMessage.full_message">
<codeclass="descname">full_message</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.full_message"title="Permalink to this definition">¶</a></dt>
<dd><p>The full message including the start line, headers, and body</p>
<codeclass="descname">full_message_pretty</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.full_message_pretty"title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <aclass="reference internal"href="#pappyproxy.http.HTTPMessage.full_message"title="pappyproxy.http.HTTPMessage.full_message"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.http.HTTPMessage.full_message()</span></code></a> except the
<codeclass="descname">headers_section</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.headers_section"title="Permalink to this definition">¶</a></dt>
<dd><p>The raw text of the headers including the extra newline at the end.</p>
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns the raw text of the headers including the extra newline at the end.</td>
<codeclass="descname">headers_section_pretty</code><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.headers_section_pretty"title="Permalink to this definition">¶</a></dt>
<dd><p>Same thing as <aclass="reference internal"href="#pappyproxy.http.HTTPMessage.headers_section"title="pappyproxy.http.HTTPMessage.headers_section"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.http.HTTPMessage.headers_section()</span></code></a> except
that the headers are colorized for terminal printing.</p>
<codeclass="descname">reserved_meta_keys</code><emclass="property"> = ['full_message']</em><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.reserved_meta_keys"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">to_json</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.HTTPMessage.to_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a JSON encoding of the message that can be used by
<codeclass="xref py py-func docutils literal"><spanclass="pre">from_json()</span></code> to recreate the message.
The <codeclass="docutils literal"><spanclass="pre">full_message</span></code> portion is base64 encoded because json doesn’t play
nice with binary blobs.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pappyproxy.http.RepeatableDict">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">RepeatableDict</code><spanclass="sig-paren">(</span><em>from_pairs=None</em>, <em>case_insensitive=False</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict"title="Permalink to this definition">¶</a></dt>
<dd><p>A dict that retains the order of items inserted and keeps track of
duplicate values. Can optionally treat keys as case insensitive.
Custom made for the proxy, so it has strange features</p>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.add_pairs">
<codeclass="descname">add_pairs</code><spanclass="sig-paren">(</span><em>pairs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.add_pairs"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>pairs</strong> (<em>List of tuples of length 2</em>) – The list of key/value pairs to add</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.all_pairs">
<codeclass="descname">all_pairs</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.all_pairs"title="Permalink to this definition">¶</a></dt>
<dd><p>A list of all the key/value pairs stored in the dictionary</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.all_vals">
<codeclass="descname">all_vals</code><spanclass="sig-paren">(</span><em>key</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.all_vals"title="Permalink to this definition">¶</a></dt>
<dd><p>Return all the values associated with a given key</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.append">
<codeclass="descname">append</code><spanclass="sig-paren">(</span><em>key</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.append"title="Permalink to this definition">¶</a></dt>
<dd><p>Append a pair to the end of the dictionary. Will add a duplicate if the key already exists.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.clear">
<codeclass="descname">clear</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.clear"title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all key/value pairs from the dictionary</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.from_dict">
<codeclass="descname">from_dict</code><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.from_dict"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the RepeatableDict to contain the same items as a normal dictionary.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>d</strong> (<aclass="reference external"href="https://docs.python.org/library/stdtypes.html#dict"title="(in Python v2.7)"><em>dict</em></a>) – The dictionary to use</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.set_val">
<codeclass="descname">set_val</code><spanclass="sig-paren">(</span><em>key</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.set_val"title="Permalink to this definition">¶</a></dt>
<dd><p>Set a value in the dictionary. Will replace the first instance of the
key with the value. If multiple values of the keys are already in the
dictionary, the duplicates of the key will be removed and the first instance
of the key will be replaced with the value. If the dictionary is case
insensitive, it will maintain the original capitalization. This is the same
behavior as assigning a value via <codeclass="docutils literal"><spanclass="pre">d[key]</span><spanclass="pre">=</span><spanclass="pre">val</span></code>. If the key is not
present, it will be added to the end of the dict.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.RepeatableDict.sort">
<codeclass="descname">sort</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.RepeatableDict.sort"title="Permalink to this definition">¶</a></dt>
<dd><p>Sort the dictionary by the key. Requires that all keys can be compared
<trclass="field-odd field"><thclass="field-name">Variables:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>time_end</strong> (<aclass="reference external"href="https://docs.python.org/library/datetime.html#datetime.datetime"title="(in Python v2.7)"><em>datetime.datetime</em></a>) – The datetime that the request ended.</li>
<li><strong>time_start</strong> (<aclass="reference external"href="https://docs.python.org/library/datetime.html#datetime.datetime"title="(in Python v2.7)"><em>datetime.datetime</em></a>) – The datetime that the request was made</li>
<li><strong>cookies</strong> (<aclass="reference internal"href="#pappyproxy.http.RepeatableDict"title="pappyproxy.http.RepeatableDict"><em>RepeatableDict</em></a>) – Cookies sent with the request</li>
<li><strong>fragment</strong> (<em>String</em>) – The fragment part of the url (The part that comes after the #)</li>
<li><strong>url_params</strong> (<aclass="reference internal"href="#pappyproxy.http.RepeatableDict"title="pappyproxy.http.RepeatableDict"><em>RepeatableDict</em></a>) – The url parameters of the request (aka the get parameters)</li>
<li><strong>path</strong> (<em>String</em>) – The path of the request</li>
<li><strong>port</strong> (<em>Integer</em>) – The port that the request was sent to (or will be sent to)</li>
<li><strong>post_params</strong> (<aclass="reference internal"href="#pappyproxy.http.RepeatableDict"title="pappyproxy.http.RepeatableDict"><em>RepeatableDict</em></a>) – The post parameters of the request</li>
<li><strong>reqid</strong> (<em>String</em>) – The request id of the request</li>
<li><strong>response</strong> (<aclass="reference internal"href="#pappyproxy.http.Response"title="pappyproxy.http.Response"><em>Response</em></a>) – The associated response of this request</li>
<li><strong>submitted</strong> (<em>Bool</em>) – Whether the request has been submitted</li>
<li><strong>unmangled</strong> (<aclass="reference internal"href="#pappyproxy.http.Request"title="pappyproxy.http.Request"><em>Request</em></a>) – If the request was mangled, the version of the request
before it was mangled.</li>
<li><strong>verb</strong> (<em>String</em>) – The HTTP verb of the request (ie POST, GET)</li>
<li><strong>version</strong> (<em>String</em>) – The HTTP version of the request (ie HTTP/1.1)</li>
<li><strong>tags</strong> (<em>List of Strings</em>) – Tags associated with the request</li>
<li><strong>plugin_data</strong> (<em>Dict</em>) – Data about the request created by plugins. If you modify this, please add your own key to it for your plugin and store all your plugin’s data under that key (probably as another dict). For example if you have a plugin called <codeclass="docutils literal"><spanclass="pre">foo</span></code>, try and store all your data under <codeclass="docutils literal"><spanclass="pre">req.plugin_data['foo']</span></code>.</li>
<li><strong>path_type</strong> (<em>Enum</em>) – An enum which describes how the path portion of the request should be represented. <codeclass="docutils literal"><spanclass="pre">PATH_RELATIVE</span></code> -> normal relative path, <codeclass="docutils literal"><spanclass="pre">PATH_ABSOLUTE</span></code> -> The absolute path (including the protocol), <codeclass="docutils literal"><spanclass="pre">PATH_HOST</span></code> -> Just the path and the port (Used for CONNECT requests when connecting to an upstream HTTP proxy).</li>
<li><strong>explicit_port</strong>– A flag to indicate that the port should always be included in the URL</li>
<codeclass="descname">async_deep_save</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.async_deep_save"title="Permalink to this definition">¶</a></dt>
<dd><p>Saves self, unmangled, response, and unmangled response. Returns a deferred
<codeclass="descname">async_save</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.async_save"title="Permalink to this definition">¶</a></dt>
<dd><p>Save/update the request in the data file. Returns a twisted deferred which
<codeclass="descname">async_submit</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.async_submit"title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <aclass="reference internal"href="#pappyproxy.http.Request.submit"title="pappyproxy.http.Request.submit"><codeclass="xref py py-func docutils literal"><spanclass="pre">submit()</span></code></a> but generates deferreds.
Submits the request using its host, port, etc. and updates its response value
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>mangle</strong> (<em>Bool</em>) – Whether to pass the request through active intercepting macros.</td>
<codeclass="descname">cache</code><emclass="property"> = <pappyproxy.requestcache.RequestCache object></em><aclass="headerlink"href="#pappyproxy.http.Request.cache"title="Permalink to this definition">¶</a></dt>
<dd><p>The request cache that stores requests in memory for performance</p>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.Request.connect_request">
<codeclass="descname">connect_request</code><aclass="headerlink"href="#pappyproxy.http.Request.connect_request"title="Permalink to this definition">¶</a></dt>
<dd><p>If the request uses SSL, this will be a request object that can be used
with an upstream HTTP server to connect to a server using SSL</p>
<codeclass="descname">deep_delete</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.deep_delete"title="Permalink to this definition">¶</a></dt>
<dd><p>Delete a request, its unmangled version, its response, and its response’s
unmangled version from history. Also removes the request from all contexts.
<codeclass="descname">full_request</code><aclass="headerlink"href="#pappyproxy.http.Request.full_request"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_plugin_dict</code><spanclass="sig-paren">(</span><em>name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.get_plugin_dict"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the data dictionary for the given plugin name.</p>
<emclass="property">static </em><codeclass="descname">load_request</code><spanclass="sig-paren">(</span><em>to_load</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.load_request"title="Permalink to this definition">¶</a></dt>
<dd><p>Load a request with the given request id and return it.
Returns a deferred which calls back with the request when complete.</p>
<li><strong>allow_special</strong> (<aclass="reference external"href="https://docs.python.org/library/functions.html#bool"title="(in Python v2.7)"><em>bool</em></a>) – Whether to allow special IDs such as <codeclass="docutils literal"><spanclass="pre">u##</span></code> or <codeclass="docutils literal"><spanclass="pre">s##</span></code></li>
<li><strong>use_cache</strong> (<aclass="reference external"href="https://docs.python.org/library/functions.html#bool"title="(in Python v2.7)"><em>bool</em></a>) – Whether to use the cache. If set to false, it will always query the data file to get the request</li>
<emclass="property">static </em><codeclass="descname">load_requests_by_tag</code><spanclass="sig-paren">(</span><em>tag</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.load_requests_by_tag"title="Permalink to this definition">¶</a></dt>
<dd><p>Load all the requests in the data file with a given tag and return them in a list.
Returns a deferred which calls back with the list of requests when complete.</p>
<emclass="property">static </em><codeclass="descname">load_requests_by_time</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.load_requests_by_time"title="Permalink to this definition">¶</a></dt>
<dd><p>Load all the requests in the data file and return them in a list.
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns the username/password tuple used for proxy authorization</td>
</tr>
<trclass="field-even field"><thclass="field-name">Setter:</th><tdclass="field-body">Sets the username/password tuple used for proxy authorization</td>
</tr>
<trclass="field-odd field"><thclass="field-name">Type:</th><tdclass="field-body">Tuple of two strings: (username, password)</td>
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns the raw text of the headers including the extra newline at the end.</td>
<codeclass="descname">save</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.save"title="Permalink to this definition">¶</a></dt>
<dd><p>Save/update the request in the data file.
Saves the request, its unmangled version, the response, and the unmanbled response.
Cannot be called from inside an async function.</p>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.Request.saved">
<codeclass="descname">saved</code><aclass="headerlink"href="#pappyproxy.http.Request.saved"title="Permalink to this definition">¶</a></dt>
<dd><p>If the request is saved in the data file</p>
<codeclass="descname">submit</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.submit"title="Permalink to this definition">¶</a></dt>
<dd><p>Submits the request using its host, port, etc. and updates its response value
to the resulting response.
Cannot be called in async functions.
This is what you should use to submit your requests in macros.</p>
<emclass="property">static </em><codeclass="descname">submit_request</code><spanclass="sig-paren">(</span><em>request</em>, <em>save_request=False</em>, <em>intercepting_macros={}</em>, <em>stream_transport=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Request.submit_request"title="Permalink to this definition">¶</a></dt>
<dd><p>Submits the request then sets <codeclass="docutils literal"><spanclass="pre">request.response</span></code>. Returns a deferred that
is called with the request that was submitted.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>request</strong>– The request to submit</li>
<li><strong>save_request</strong> (<em>Bool</em>) – Whether to save the request to history</li>
<li><strong>intercepting_macros</strong> (<em>Dict or collections.OrderedDict</em>) – Dictionary of intercepting macros to be applied to the request</li>
<li><strong>stream_transport</strong> (<em>twisted.internet.interfaces.ITransport</em>) – Return transport to stream to. Set to None to not stream the response.</li>
<emclass="property">class </em><codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">Response</code><spanclass="sig-paren">(</span><em>full_response=None</em>, <em>update_content_length=True</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Variables:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>cookies</strong> (<em>RepeatableDict of ResponseCookie objects</em>) – Cookies set by the response</li>
<li><strong>response_code</strong> (<em>Integer</em>) – The response code of the response</li>
<li><strong>response_text</strong> (<em>String</em>) – The text associated with the response code (ie OK, NOT FOUND, etc)</li>
<li><strong>rspid</strong> (<em>String</em>) – If the response is saved in the data file, the id of the response</li>
<li><strong>unmangled</strong> (<aclass="reference internal"href="#pappyproxy.http.Response"title="pappyproxy.http.Response"><em>Response</em></a>) – If the response was mangled, the unmangled version of the response</li>
<li><strong>version</strong> (<em>String</em>) – The version part of the status line (ie HTTP/1.1)</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="pappyproxy.http.Response.add_cookie">
<codeclass="descname">add_cookie</code><spanclass="sig-paren">(</span><em>cookie</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.add_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.http.ResponseCookie</span></code></a> to the response.</p>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">This will add duplicate cookies. If you want to add a cookie you’re not sure exists,
use <aclass="reference internal"href="#pappyproxy.http.Response.set_cookie"title="pappyproxy.http.Response.set_cookie"><codeclass="xref py py-func docutils literal"><spanclass="pre">set_cookie()</span></code></a></p>
</div>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.Response.async_save">
<codeclass="descname">async_save</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.async_save"title="Permalink to this definition">¶</a></dt>
<dd><p>Save/update the just request in the data file. Returns a twisted deferred which
fires when the save is complete. It is suggested that you use
:func: <cite>~pappyproxy.http.Request.async_deep_save</cite> instead to save responses.</p>
<codeclass="descname">delete_cookie</code><spanclass="sig-paren">(</span><em>key</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.delete_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Delete a cookie from the response by its key</p>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.Response.full_response">
<codeclass="descname">full_response</code><aclass="headerlink"href="#pappyproxy.http.Response.full_response"title="Permalink to this definition">¶</a></dt>
<dd><p>The full text of the response including the headers and data.
<emclass="property">static </em><codeclass="descname">load_response</code><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.load_response"title="Permalink to this definition">¶</a></dt>
<dd><p>Load a response from its response id. Returns a deferred. I don’t suggest you use this.</p>
<codeclass="descname">raw_headers</code><aclass="headerlink"href="#pappyproxy.http.Response.raw_headers"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns the raw text of the headers including the extra newline at the end.</td>
<codeclass="descname">set_cookie</code><spanclass="sig-paren">(</span><em>cookie</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.set_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Set a cookie in the response. <codeclass="docutils literal"><spanclass="pre">cookie</span></code> must be a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.http.ResponseCookie</span></code></a></p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.http.Response.set_cookie_kv">
<codeclass="descname">set_cookie_kv</code><spanclass="sig-paren">(</span><em>key</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.Response.set_cookie_kv"title="Permalink to this definition">¶</a></dt>
<dd><p>Set a cookie by key and value. Will not have path, secure, etc set at all.</p>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.Response.soup">
<codeclass="descname">soup</code><aclass="headerlink"href="#pappyproxy.http.Response.soup"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a beautifulsoup4 object for parsing the html of the response</p>
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns a BeautifulSoup object representing the html of the response</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="attribute">
<dtid="pappyproxy.http.Response.start_line">
<codeclass="descname">start_line</code><aclass="headerlink"href="#pappyproxy.http.Response.start_line"title="Permalink to this definition">¶</a></dt>
<dd><p>The status line of the response. ie <cite>HTTP/1.1 200 OK</cite></p>
<emclass="property">class </em><codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">ResponseCookie</code><spanclass="sig-paren">(</span><em>set_cookie_string=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.ResponseCookie"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">cookie_str</code><aclass="headerlink"href="#pappyproxy.http.ResponseCookie.cookie_str"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the full string of the cookie. ie <codeclass="docutils literal"><spanclass="pre">foo=bar;</span><spanclass="pre">secure;</span><spanclass="pre">path=/</span></code></p>
<trclass="field-odd field"><thclass="field-name">Getter:</th><tdclass="field-body">Returns the full string of the cookie.</td>
</tr>
<trclass="field-even field"><thclass="field-name">Setter:</th><tdclass="field-body">Set the metadata from a cookie string. ie from a <codeclass="docutils literal"><spanclass="pre">Set-Cookie</span></code> header</td>
<codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">async_submit_requests</code><spanclass="sig-paren">(</span><em>reqs</em>, <em>mangle=False</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.async_submit_requests"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>mangle</strong> (<em>Bool</em>) – Whether to pass the requests through intercepting macros</td>
<codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">get_request</code><spanclass="sig-paren">(</span><em>url=''</em>, <em>url_params={}</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.get_request"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a request object that makes a GET request to the given url with the
given url params.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.http.init">
<codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">init</code><spanclass="sig-paren">(</span><em>pool</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.init"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>pool</strong> (<em>SQLite ConnectionPool</em>) – The ConnectionPool to use to store the request/response objects</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.http.post_request">
<codeclass="descclassname">pappyproxy.http.</code><codeclass="descname">post_request</code><spanclass="sig-paren">(</span><em>url</em>, <em>post_params={}</em>, <em>url_params={}</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.http.post_request"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a request object that makes a POST request to the given url with the
given post and url params.</p>
</dd></dl>
</div>
<divclass="section"id="module-pappyproxy.iter">
<spanid="pappyproxy-iter-module"></span><h2>pappyproxy.iter module<aclass="headerlink"href="#module-pappyproxy.iter"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="pappyproxy.iter.common_passwords">
<codeclass="descclassname">pappyproxy.iter.</code><codeclass="descname">common_passwords</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.iter.common_passwords"title="Permalink to this definition">¶</a></dt>
<dd><p>List common passwords</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.iter.common_usernames">
<codeclass="descclassname">pappyproxy.iter.</code><codeclass="descname">common_usernames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.iter.common_usernames"title="Permalink to this definition">¶</a></dt>
<dd><p>List common usernames</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.iter.fuzz_path_trav">
<codeclass="descclassname">pappyproxy.iter.</code><codeclass="descname">fuzz_path_trav</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.iter.fuzz_path_trav"title="Permalink to this definition">¶</a></dt>
<dd><p>Fuzz common values for path traversal.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.iter.fuzz_sqli">
<codeclass="descclassname">pappyproxy.iter.</code><codeclass="descname">fuzz_sqli</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.iter.fuzz_sqli"title="Permalink to this definition">¶</a></dt>
<dd><p>Fuzz common values that could cause sql errors</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.iter.fuzz_xss">
<codeclass="descclassname">pappyproxy.iter.</code><codeclass="descname">fuzz_xss</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.iter.fuzz_xss"title="Permalink to this definition">¶</a></dt>
<dd><p>Fuzz values for finding XSS</p>
</dd></dl>
</div>
<divclass="section"id="module-pappyproxy.macros">
<spanid="pappyproxy-macros-module"></span><h2>pappyproxy.macros module<aclass="headerlink"href="#module-pappyproxy.macros"title="Permalink to this headline">¶</a></h2>
<dlclass="class">
<dtid="pappyproxy.macros.FileInterceptMacro">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">FileInterceptMacro</code><spanclass="sig-paren">(</span><em>filename=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.macros.FileInterceptMacro"title="Permalink to this definition">¶</a></dt>
<p>An intercepting macro that loads a macro from a file.</p>
</dd></dl>
<dlclass="class">
<dtid="pappyproxy.macros.InterceptMacro">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">InterceptMacro</code><aclass="headerlink"href="#pappyproxy.macros.InterceptMacro"title="Permalink to this definition">¶</a></dt>
<p>A class representing a macro that modifies requests as they pass through the
proxy</p>
</dd></dl>
<dlclass="class">
<dtid="pappyproxy.macros.Macro">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">Macro</code><spanclass="sig-paren">(</span><em>filename=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.macros.Macro"title="Permalink to this definition">¶</a></dt>
<p>A class representing a macro that can perform a series of requests and add
data to storage.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.macros.load_macros">
<codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">load_macros</code><spanclass="sig-paren">(</span><em>loc</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.macros.load_macros"title="Permalink to this definition">¶</a></dt>
<dd><p>Loads the macros stored in the location and returns a list of Macro objects</p>
<codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">mangle_request</code><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.macros.mangle_request"title="Permalink to this definition">¶</a></dt>
<dd><p>Mangle a request with a list of intercepting macros.
Returns a tuple that contains the resulting request (with its unmangled
value set if needed) and a bool that states whether the request was modified
Returns (None, True) if the request was dropped.</p>
<codeclass="descclassname">pappyproxy.macros.</code><codeclass="descname">mangle_response</code><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.macros.mangle_response"title="Permalink to this definition">¶</a></dt>
<dd><p>Mangle a request’s response with a list of intercepting macros.
Returns a bool stating whether the request’s response was modified.
<spanid="pappyproxy-pappy-module"></span><h2>pappyproxy.pappy module<aclass="headerlink"href="#module-pappyproxy.pappy"title="Permalink to this headline">¶</a></h2>
<codeclass="descclassname">pappyproxy.pappy.</code><codeclass="descname">session</code><aclass="headerlink"href="#pappyproxy.pappy.session"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The <aclass="reference internal"href="#pappyproxy.pappy.PappySession"title="pappyproxy.pappy.PappySession"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.pappy.PappySession</span></code></a> object for the current session. Mainly
used for accessing the session’s config information.</p>
<dlclass="class">
<dtid="pappyproxy.pappy.PappySession">
<emclass="property">class </em><codeclass="descclassname">pappyproxy.pappy.</code><codeclass="descname">PappySession</code><spanclass="sig-paren">(</span><em>sessconfig</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.pappy.PappySession"title="Permalink to this definition">¶</a></dt>
<spanid="pappyproxy-plugin-module"></span><h2>pappyproxy.plugin module<aclass="headerlink"href="#module-pappyproxy.plugin"title="Permalink to this headline">¶</a></h2>
<p>This module contains all the api calls written for use in plugins. If you want
to do anything that is’t allowed through these function calls or through the
functions provided for macros, contact me and I’ll see what I can do to add some
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">active_intercepting_macros</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.active_intercepting_macros"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">add_intercepting_macro</code><spanclass="sig-paren">(</span><em>name</em>, <em>macro</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.add_intercepting_macro"title="Permalink to this definition">¶</a></dt>
<dd><p>Adds an intercepting macro to the proxy. You can either use a
<aclass="reference internal"href="#pappyproxy.macros.FileInterceptMacro"title="pappyproxy.macros.FileInterceptMacro"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.macros.FileInterceptMacro</span></code></a> to load an
intercepting macro from the disk, or you can create your own using
an <aclass="reference internal"href="#pappyproxy.macros.InterceptMacro"title="pappyproxy.macros.InterceptMacro"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.macros.InterceptMacro</span></code></a> for a base class. You
must give a unique name that will be used in
<aclass="reference internal"href="#pappyproxy.plugin.remove_intercepting_macro"title="pappyproxy.plugin.remove_intercepting_macro"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.plugin.remove_intercepting_macro()</span></code></a> to deactivate
it. Remember that activating an intercepting macro will disable
request streaming and will affect performance. So please try and
only use this if you may need to modify messages before they are
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">add_to_history</code><spanclass="sig-paren">(</span><em>req</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.add_to_history"title="Permalink to this definition">¶</a></dt>
<dd><p>Save a request to history without saving it to the data file. The request
will only be saved in memory, so when the program is exited or <cite>clrmem</cite>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>req</strong> (<aclass="reference internal"href="#pappyproxy.http.Request"title="pappyproxy.http.Request"><codeclass="xref py py-class docutils literal"><spanclass="pre">pappyproxy.http.Request</span></code></a>) – The request to add to history</td>
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">async_main_context_ids</code><spanclass="sig-paren">(</span><em>n=-1</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.async_main_context_ids"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a deferred that resolves into a list of up to <codeclass="docutils literal"><spanclass="pre">n</span></code> of the
most recent requests in the main context. You can then use
<aclass="reference internal"href="#pappyproxy.http.Request.load_request"title="pappyproxy.http.Request.load_request"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.http.Request.load_request()</span></code></a> to load the requests
in the current context. If no value is passed for <codeclass="docutils literal"><spanclass="pre">n</span></code>, this will
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">in_memory_reqs</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.in_memory_reqs"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list containing the ids of the requests which exist in
memory only (requests with an m## style id). You can call either
<aclass="reference internal"href="#pappyproxy.http.Request.save"title="pappyproxy.http.Request.save"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.http.Request.save()</span></code></a> or
<aclass="reference internal"href="#pappyproxy.http.Request.async_deep_save"title="pappyproxy.http.Request.async_deep_save"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.http.Request.async_deep_save()</span></code></a> to save the
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">main_context_ids</code><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.main_context_ids"title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <aclass="reference internal"href="#pappyproxy.plugin.async_main_context_ids"title="pappyproxy.plugin.async_main_context_ids"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.plugin.async_main_context_ids()</span></code></a> but can be called
from macros and other non-async only functions. Cannot be called in async
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">plugin_by_name</code><spanclass="sig-paren">(</span><em>name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.plugin_by_name"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an interface to access the methods of a plugin from its
name. For example, to call the <codeclass="docutils literal"><spanclass="pre">foo</span></code> function from the <codeclass="docutils literal"><spanclass="pre">bar</span></code>
plugin you would call <codeclass="docutils literal"><spanclass="pre">plugin_by_name('bar').foo()</span></code>.</p>
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">remove_intercepting_macro</code><spanclass="sig-paren">(</span><em>name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.remove_intercepting_macro"title="Permalink to this definition">¶</a></dt>
<dd><p>Stops an active intercepting macro. You must pass in the name that
you used when calling
<aclass="reference internal"href="#pappyproxy.plugin.add_intercepting_macro"title="pappyproxy.plugin.add_intercepting_macro"><codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.plugin.add_intercepting_macro()</span></code></a> to identify which
macro you would like to stop.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.plugin.req_history">
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">req_history</code><spanclass="sig-paren">(</span><em>num=-1</em>, <em>ids=None</em>, <em>include_unmangled=False</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.req_history"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an a generator that generates deferreds which resolve to
requests in history, ignoring the current context. If <codeclass="docutils literal"><spanclass="pre">n</span></code> is
given, it will stop after <codeclass="docutils literal"><spanclass="pre">n</span></code> requests have been generated. If
<codeclass="docutils literal"><spanclass="pre">ids</span></code> is given, it will only include those IDs. If
<codeclass="docutils literal"><spanclass="pre">include_unmangled</span></code> is True, then the iterator will include
requests which are the unmangled version of other requests.</p>
<p>An example of using the iterator to print the 10 most recent requests:</p>
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">require_modules</code><spanclass="sig-paren">(</span><em>*largs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.require_modules"title="Permalink to this definition">¶</a></dt>
<dd><p>A wrapper to make sure that plugin dependencies are installed. For example,
if a command requires the <codeclass="docutils literal"><spanclass="pre">psutil</span></code> and <codeclass="docutils literal"><spanclass="pre">objgraph</span></code> package, you should
<codeclass="descclassname">pappyproxy.plugin.</code><codeclass="descname">run_cmd</code><spanclass="sig-paren">(</span><em>cmd</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.plugin.run_cmd"title="Permalink to this definition">¶</a></dt>
<spanid="pappyproxy-proxy-module"></span><h2>pappyproxy.proxy module<aclass="headerlink"href="#module-pappyproxy.proxy"title="Permalink to this headline">¶</a></h2>
<spanid="pappyproxy-repeater-module"></span><h2>pappyproxy.repeater module<aclass="headerlink"href="#module-pappyproxy.repeater"title="Permalink to this headline">¶</a></h2>
<spanid="pappyproxy-session-module"></span><h2>pappyproxy.session module<aclass="headerlink"href="#module-pappyproxy.session"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="descclassname">pappyproxy.session.</code><codeclass="descname">Session</code><spanclass="sig-paren">(</span><em>cookie_names=None</em>, <em>header_names=None</em>, <em>cookie_vals=None</em>, <em>header_vals=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session"title="Permalink to this definition">¶</a></dt>
<p>A class used to maintain a session over multiple requests. Can remember cookies
and apply a specific header to requests. It is also possible to give the session
a list of cookie names and it will only save those cookies.</p>
<dlclass="method">
<dtid="pappyproxy.session.Session.apply_req">
<codeclass="descname">apply_req</code><spanclass="sig-paren">(</span><em>request</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.apply_req"title="Permalink to this definition">¶</a></dt>
<dd><p>Apply saved headers and cookies to the request</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.session.Session.apply_rsp">
<codeclass="descname">apply_rsp</code><spanclass="sig-paren">(</span><em>response</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.apply_rsp"title="Permalink to this definition">¶</a></dt>
<dd><p>Will add a Set-Cookie header for each saved cookie. Will not
apply any saved headers. If the cookie was added from a call to
<aclass="reference internal"href="#pappyproxy.session.Session.save_rsp"title="pappyproxy.session.Session.save_rsp"><codeclass="xref py py-func docutils literal"><spanclass="pre">save_rsp()</span></code></a>, the Set-Cookie flags
will be the same as the original response.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.session.Session.get_cookie">
<codeclass="descname">get_cookie</code><spanclass="sig-paren">(</span><em>key</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.get_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a string with the value of the cookie with the given string, even if the value is a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a>.
If you want to get a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a>, use <aclass="reference internal"href="#pappyproxy.session.Session.get_rsp_cookie"title="pappyproxy.session.Session.get_rsp_cookie"><codeclass="xref py py-func docutils literal"><spanclass="pre">get_rsp_cookie()</span></code></a>.</p>
<codeclass="descname">get_rsp_cookie</code><spanclass="sig-paren">(</span><em>key</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.get_rsp_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a> associated with the key
regardless of if the value is stored as a string or a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a>.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.session.Session.save_req">
<codeclass="descname">save_req</code><spanclass="sig-paren">(</span><em>req</em>, <em>cookies=None</em>, <em>headers=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.save_req"title="Permalink to this definition">¶</a></dt>
<dd><p>Updates the state of the session from the given request.
Cookie and headers can be added to their whitelists by passing in a list
for either <codeclass="docutils literal"><spanclass="pre">cookies</span></code> or <codeclass="docutils literal"><spanclass="pre">headers</span></code>.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.session.Session.save_rsp">
<codeclass="descname">save_rsp</code><spanclass="sig-paren">(</span><em>rsp</em>, <em>cookies=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.save_rsp"title="Permalink to this definition">¶</a></dt>
<dd><p>Update the state of the session from the response. Only cookies can be
updated from a response. Additional values can be added to the whitelist
by passing in a list of values for the <codeclass="docutils literal"><spanclass="pre">cookies</span></code> parameter. If save_all
is given, all set cookies will be added to the session.</p>
</dd></dl>
<dlclass="method">
<dtid="pappyproxy.session.Session.set_cookie">
<codeclass="descname">set_cookie</code><spanclass="sig-paren">(</span><em>key</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.session.Session.set_cookie"title="Permalink to this definition">¶</a></dt>
<dd><p>Set a cookie in the session. <codeclass="docutils literal"><spanclass="pre">val</span></code> can be either a string or a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a>.
If a <aclass="reference internal"href="#pappyproxy.http.ResponseCookie"title="pappyproxy.http.ResponseCookie"><codeclass="xref py py-class docutils literal"><spanclass="pre">ResponseCookie</span></code></a> is used, make sure its <codeclass="docutils literal"><spanclass="pre">key</span></code> value is the same as
<spanid="pappyproxy-util-module"></span><h2>pappyproxy.util module<aclass="headerlink"href="#module-pappyproxy.util"title="Permalink to this headline">¶</a></h2>
<dlclass="exception">
<dtid="pappyproxy.util.PappyException">
<emclass="property">exception </em><codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">PappyException</code><aclass="headerlink"href="#pappyproxy.util.PappyException"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">confirm</code><spanclass="sig-paren">(</span><em>message</em>, <em>default='n'</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.confirm"title="Permalink to this definition">¶</a></dt>
<dd><p>A helper function to get confirmation from the user. It prints <codeclass="docutils literal"><spanclass="pre">message</span></code>
then asks the user to answer yes or no. Returns True if the user answers
yes, otherwise returns False.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.util.get_req_data_row">
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">get_req_data_row</code><spanclass="sig-paren">(</span><em>request</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.get_req_data_row"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the row data for a request to be printed.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.util.load_reqlist">
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">load_reqlist</code><spanclass="sig-paren">(</span><em>line</em>, <em>allow_special=True</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.load_reqlist"title="Permalink to this definition">¶</a></dt>
<dd><p>A helper function for parsing a list of requests that are passed as an
argument. If <codeclass="docutils literal"><spanclass="pre">allow_special</span></code> is True, then it will parse IDs such as
<codeclass="docutils literal"><spanclass="pre">u123</span></code> or <codeclass="docutils literal"><spanclass="pre">s123</span></code>. Even if allow_special is false, it will still parse
<codeclass="docutils literal"><spanclass="pre">m##</span></code> IDs. Will print any errors with loading any of the requests and
will return a list of all the requests which were successfully loaded.
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">print_request_rows</code><spanclass="sig-paren">(</span><em>request_rows</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.print_request_rows"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes in a list of request rows generated from <codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.console.get_req_data_row()</span></code>
and prints a table with data on each of the
requests. Used instead of <codeclass="xref py py-func docutils literal"><spanclass="pre">pappyproxy.console.print_requests()</span></code> if you
can’t count on storing all the requests in memory at once.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.util.print_requests">
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">print_requests</code><spanclass="sig-paren">(</span><em>requests</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.print_requests"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes in a list of requests and prints a table with data on each of the
requests. It’s the same table that’s used by <codeclass="docutils literal"><spanclass="pre">ls</span></code>.</p>
</dd></dl>
<dlclass="function">
<dtid="pappyproxy.util.print_table">
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">print_table</code><spanclass="sig-paren">(</span><em>coldata</em>, <em>rows</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.print_table"title="Permalink to this definition">¶</a></dt>
<dd><p>Print a table.
Coldata: List of dicts with info on how to print the columns.
<codeclass="docutils literal"><spanclass="pre">name</span></code> is the heading to give column,
<codeclass="docutils literal"><spanclass="pre">width</span><spanclass="pre">(optional)</span></code> maximum width before truncating. 0 for unlimited.</p>
<p>Rows: List of tuples with the data to print</p>
<codeclass="descclassname">pappyproxy.util.</code><codeclass="descname">printable_data</code><spanclass="sig-paren">(</span><em>data</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#pappyproxy.util.printable_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Return <codeclass="docutils literal"><spanclass="pre">data</span></code>, but replaces unprintable characters with periods.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>data</strong> (<em>String</em>) – The data to make printable</td>