mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-12-12 07:08:55 +00:00
9 lines
989 B
HTML
9 lines
989 B
HTML
<div class="highlight"><pre><span class="c">#!/usr/bin/env python</span>
|
|
<span class="kn">from</span> <span class="nn">libpathod</span> <span class="kn">import</span> <span class="n">pathoc</span>
|
|
|
|
<span class="n">p</span> <span class="o">=</span> <span class="n">pathoc</span><span class="o">.</span><span class="n">Pathoc</span><span class="p">((</span><span class="s">"google.com"</span><span class="p">,</span> <span class="mi">80</span><span class="p">))</span>
|
|
<span class="n">p</span><span class="o">.</span><span class="n">connect</span><span class="p">()</span>
|
|
<span class="k">print</span> <span class="n">p</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"get:/"</span><span class="p">)</span>
|
|
<span class="k">print</span> <span class="n">p</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"get:/foo"</span><span class="p">)</span>
|
|
</pre></div>
|