summaryrefslogtreecommitdiff
path: root/examples/websockets/doc/sslechoserver.qdoc
blob: 41ab060b535ced8f96650ab5c72be883040caac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

/*!
    \example sslechoserver
    \title Secure WebSocket Echo Server
    \examplecategory {Networking}
    \ingroup qtwebsockets-examples
    \brief A simple server to respond to clients over secure WebSockets (wss).

    The Secure WebSocket Echo Server example shows how to use the QWebSocketServer
    class to implement a simple echo server over secure sockets (wss). TLS support
    is required for this example to work. It authenticates itself to the client
    and, on success, can accept a message from the client, to which it responds.
    For the sake of illustration, its response is simply a copy of the message
    it was sent.

    This server is configured with a self-signed certificate and key.
    Unless the clients contacting this server is configured to trust that
    certificate, which \l {Secure WebSocket Echo Client} does, they will reject
    this server.

    \image sslechoclient-html-example.webp Secure WebSocket Echo HTML Client

    There is an HTML-based client as part of this example. But it will only
    work either if the browser used supports the certificate as described above,
    or if it ignores TLS errors for localhost addresses.

    \sa {Secure WebSocket Echo Client}, {WebSocket Echo Server}
*/