mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 16:17:49 +00:00
Split up language docs, document websocket code specification.
This commit is contained in:
parent
4b2e00acb3
commit
179cc8dc1f
@ -16,257 +16,17 @@
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="specifying_responses">
|
||||
|
||||
<pre class="example">code:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
<tr>
|
||||
<td> code </td>
|
||||
<td>
|
||||
<p>An integer specifying the HTTP response code.</p>
|
||||
|
||||
<p>The special method <b>ws</b> creates a valid
|
||||
websocket upgrade response (code 101), and moves pathod
|
||||
to websocket mode. Apart from that, websocket responses
|
||||
are just like any other, and all aspects of the
|
||||
response can be over-ridden.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the body. The appropriate Content-Length header is
|
||||
added automatically unless the "r" flag is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> c<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Content-Type header. Equivalent to
|
||||
h"Content-Type"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set a header.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> l<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Location header. Equivalent to
|
||||
h"Location"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> m<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
HTTP Reason message. Automatically chosen according to
|
||||
the response code if not specified.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> r </td>
|
||||
<td>
|
||||
Set the "raw" flag on this response. Pathod will not
|
||||
calculate a Content-Length header if a body is set, or add
|
||||
a Date header to the response.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "docs_lang_responses.html" %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane active" id="specifying_requests">
|
||||
|
||||
<pre class="example">method:path:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
|
||||
<tr>
|
||||
<td> method </td>
|
||||
<td>
|
||||
|
||||
<p>A <a href="#valuespec">VALUE</a> specifying the HTTP
|
||||
method to use. Standard methods do not need to be
|
||||
enclosed in quotes, while non-standard methods can be
|
||||
specified as quoted strings.</p>
|
||||
|
||||
<p>The special method <b>ws</b> creates a valid
|
||||
websocket upgrade GET request, and signals to pathoc to
|
||||
switch to websocket recieve mode if the server responds
|
||||
correctly. Apart from that, websocket requests are just
|
||||
like any other, and all aspects of the request can be
|
||||
over-ridden.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the body. The appropriate Content-Length header is
|
||||
added automatically unless the "r" flag is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> c<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Content-Type header. Equivalent to
|
||||
h"Content-Type"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set a header.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> r </td>
|
||||
<td>
|
||||
Set the "raw" flag on this response. Pathod will not
|
||||
calculate a Content-Length header if a body is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> s<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
An embedded Response specification, appended to the path
|
||||
of the request.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> u<a href="#valuespec">VALUE</a> <br> uSHORTCUT </td>
|
||||
|
||||
<td>
|
||||
|
||||
Set a User-Agent header on this request. You can
|
||||
specify either a complete <a
|
||||
href="#valuespec">VALUE</a>, or a User-Agent shortcut:
|
||||
|
||||
<table class="table table-condensed">
|
||||
{% for i in uastrings %}
|
||||
<tr>
|
||||
<td><b>{{ i[1] }}</b></td>
|
||||
<td>{{ i[0] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "docs_lang_requests.html" %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="websockets">
|
||||
|
||||
<pre class="example">wf:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the frame payload. If a masking key is present, the
|
||||
value is encoded automatically.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{% include "docs_lang_websockets.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<section id="specifying_requests">
|
||||
<section id="features">
|
||||
<div class="page-header">
|
||||
<h1>Features</h1>
|
||||
</div>
|
||||
|
107
libpathod/templates/docs_lang_requests.html
Normal file
107
libpathod/templates/docs_lang_requests.html
Normal file
@ -0,0 +1,107 @@
|
||||
|
||||
<pre class="example">method:path:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
|
||||
<tr>
|
||||
<td> method </td>
|
||||
<td>
|
||||
|
||||
<p>A <a href="#valuespec">VALUE</a> specifying the HTTP
|
||||
method to use. Standard methods do not need to be
|
||||
enclosed in quotes, while non-standard methods can be
|
||||
specified as quoted strings.</p>
|
||||
|
||||
<p>The special method <b>ws</b> creates a valid
|
||||
websocket upgrade GET request, and signals to pathoc to
|
||||
switch to websocket recieve mode if the server responds
|
||||
correctly. Apart from that, websocket requests are just
|
||||
like any other, and all aspects of the request can be
|
||||
over-ridden.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the body. The appropriate Content-Length header is
|
||||
added automatically unless the "r" flag is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> c<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Content-Type header. Equivalent to
|
||||
h"Content-Type"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set a header.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> r </td>
|
||||
<td>
|
||||
Set the "raw" flag on this response. Pathod will not
|
||||
calculate a Content-Length header if a body is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> s<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
An embedded Response specification, appended to the path
|
||||
of the request.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> u<a href="#valuespec">VALUE</a> <br> uSHORTCUT </td>
|
||||
|
||||
<td>
|
||||
|
||||
Set a User-Agent header on this request. You can
|
||||
specify either a complete <a
|
||||
href="#valuespec">VALUE</a>, or a User-Agent shortcut:
|
||||
|
||||
<table class="table table-condensed">
|
||||
{% for i in uastrings %}
|
||||
<tr>
|
||||
<td><b>{{ i[1] }}</b></td>
|
||||
<td>{{ i[0] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
90
libpathod/templates/docs_lang_responses.html
Normal file
90
libpathod/templates/docs_lang_responses.html
Normal file
@ -0,0 +1,90 @@
|
||||
|
||||
<pre class="example">code:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
<tr>
|
||||
<td> code </td>
|
||||
<td>
|
||||
<p>An integer specifying the HTTP response code.</p>
|
||||
|
||||
<p>The special method <b>ws</b> creates a valid
|
||||
websocket upgrade response (code 101), and moves pathod
|
||||
to websocket mode. Apart from that, websocket responses
|
||||
are just like any other, and all aspects of the
|
||||
response can be over-ridden.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the body. The appropriate Content-Length header is
|
||||
added automatically unless the "r" flag is set.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> c<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Content-Type header. Equivalent to
|
||||
h"Content-Type"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set a header.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> l<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
A shortcut for setting the Location header. Equivalent to
|
||||
h"Location"=VALUE
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> m<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
HTTP Reason message. Automatically chosen according to
|
||||
the response code if not specified.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> r </td>
|
||||
<td>
|
||||
Set the "raw" flag on this response. Pathod will not
|
||||
calculate a Content-Length header if a body is set, or add
|
||||
a Date header to the response.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
48
libpathod/templates/docs_lang_websockets.html
Normal file
48
libpathod/templates/docs_lang_websockets.html
Normal file
@ -0,0 +1,48 @@
|
||||
<pre class="example">wf:[colon-separated list of features]</pre></p>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tbody >
|
||||
|
||||
<tr>
|
||||
<td> b<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Set the frame payload. If a masking key is present, the
|
||||
value is encoded automatically.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> c<a href="#valuespec">INTEGER</a> </td>
|
||||
<td>
|
||||
|
||||
Set the op code. This can either be an integer from 0-15, or be
|
||||
one of the following opcode names: <b>continue</b>,
|
||||
<b>text</b>, <b>binary</b>, <b>close</b>, <b>ping</b>,
|
||||
<b>pong</b>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> d<a href="#offsetspec">OFFSET</a> </td>
|
||||
<td>
|
||||
Disconnect after OFFSET bytes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
|
||||
<td>
|
||||
Inject the specified value at the offset.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> p<a href="#offsetspec">OFFSET</a>,SECONDS </td>
|
||||
<td>
|
||||
Pause for SECONDS seconds after OFFSET bytes. SECONDS can
|
||||
be an integer or "f" to pause forever.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in New Issue
Block a user