diff options
Diffstat (limited to 'libpathod/templates')
| -rw-r--r-- | libpathod/templates/docs_lang.html | 38 | ||||
| -rw-r--r-- | libpathod/templates/request_previewform.html | 6 | ||||
| -rw-r--r-- | libpathod/templates/response_previewform.html | 8 |
3 files changed, 50 insertions, 2 deletions
diff --git a/libpathod/templates/docs_lang.html b/libpathod/templates/docs_lang.html index 4ed7f151..e67b13c5 100644 --- a/libpathod/templates/docs_lang.html +++ b/libpathod/templates/docs_lang.html @@ -11,6 +11,7 @@ <ul class="nav nav-tabs"> <li class="active"><a href="#specifying_responses" data-toggle="tab">Responses</a></li> <li><a href="#specifying_requests" data-toggle="tab">Requests</a></li> + <li><a href="#websockets" data-toggle="tab">Websockets</a></li> </ul> <div class="tab-content"> @@ -199,6 +200,43 @@ </table> </div> + <div class="tab-pane" id="websockets"> + + <p>Requests and responses can be decorated with the <b>ws</b> prefix to + create a websockets client or server handshake. Since the websocket + specifier implies a request method (GET) and a response code (102), + these can optionally be omitted. All other request and response + features can be applied, and websocket-specific headers can be + over-ridden explicitly.</p> + + <h2>Request</h2> + + <pre class="example">ws:[method:]path:[colon-separated list of features]</pre></p> + + <p>This will generate a wsocket client handshake with a GET method:</p> + + <pre class="example">ws:/</pre></p> + + <p>This will do the same, but using the (invalid) PUT method:</p> + + <pre class="example">ws:put:/</pre></p> + + + <h2>Response</h2> + + <pre class="example">ws[:code:][colon-separated list of features]</pre></p> + + <p>This will generate a simple protocol acceptance with a 101 response + code:</p> + + <pre class="example">ws</pre></p> + + <p>This will do the same, but using the (invalid) 202 code:</p> + + <pre class="example">ws:202</pre></p> + + </div> + </div> diff --git a/libpathod/templates/request_previewform.html b/libpathod/templates/request_previewform.html index 607bfefd..d3083735 100644 --- a/libpathod/templates/request_previewform.html +++ b/libpathod/templates/request_previewform.html @@ -1,5 +1,5 @@ <form style="margin-bottom: 0" class="form-inline" method="GET" action="/request_preview"> - <input + <input style="width: 18em" id="spec" name="spec" @@ -46,6 +46,10 @@ <td><a href="/request_preview?spec=get:/:b@100,ascii:ir,@1">get:/:b@100,ascii:ir,@1</a></td> <td>100 ASCII bytes as the body, and randomly inject a random byte</td> </tr> + <tr> + <td><a href="/request_preview?spec=ws:/">ws:/</a></td> + <td>Initiate a websocket handshake.</td> + </tr> </tbody> </table> </div> diff --git a/libpathod/templates/response_previewform.html b/libpathod/templates/response_previewform.html index fbc3de5a..28551015 100644 --- a/libpathod/templates/response_previewform.html +++ b/libpathod/templates/response_previewform.html @@ -1,5 +1,5 @@ <form style="margin-bottom: 0" class="form-inline" method="GET" action="/response_preview"> - <input + <input style="width: 18em" id="spec" name="spec" @@ -68,6 +68,12 @@ </td> <td>100 ASCII bytes as the body, randomly generated 100k header name, with the value 'foo'.</td> </tr> + <tr> + <td> + <a href="/response_preview?spec=ws">ws</a> + </td> + <td>A websocket connection acceptance handshake.</td> + </tr> </tbody> </table> </div> |
