|
| 1 | +Server (:mod:`trio`) |
| 2 | +======================= |
| 3 | + |
| 4 | +.. automodule:: websockets.trio.server |
| 5 | + |
| 6 | +.. Creating a server |
| 7 | +.. ----------------- |
| 8 | +
|
| 9 | +.. .. autofunction:: serve |
| 10 | +.. :async: |
| 11 | +
|
| 12 | +.. .. autofunction:: unix_serve |
| 13 | +.. :async: |
| 14 | +
|
| 15 | +.. Routing connections |
| 16 | +.. ------------------- |
| 17 | +
|
| 18 | +.. .. automodule:: websockets.trio.router |
| 19 | +
|
| 20 | +.. .. autofunction:: route |
| 21 | +.. :async: |
| 22 | +
|
| 23 | +.. .. autofunction:: unix_route |
| 24 | +.. :async: |
| 25 | +
|
| 26 | +.. .. autoclass:: Router |
| 27 | +
|
| 28 | +.. .. currentmodule:: websockets.trio.server |
| 29 | +
|
| 30 | +.. Running a server |
| 31 | +.. ---------------- |
| 32 | +
|
| 33 | +.. .. autoclass:: Server |
| 34 | +
|
| 35 | +.. .. autoattribute:: connections |
| 36 | +
|
| 37 | +.. .. automethod:: close |
| 38 | +
|
| 39 | +.. .. automethod:: wait_closed |
| 40 | +
|
| 41 | +.. .. automethod:: get_loop |
| 42 | +
|
| 43 | +.. .. automethod:: is_serving |
| 44 | +
|
| 45 | +.. .. automethod:: start_serving |
| 46 | +
|
| 47 | +.. .. automethod:: serve_forever |
| 48 | +
|
| 49 | +.. .. autoattribute:: sockets |
| 50 | +
|
| 51 | +.. Using a connection |
| 52 | +.. ------------------ |
| 53 | +
|
| 54 | +.. .. autoclass:: ServerConnection |
| 55 | +
|
| 56 | +.. .. automethod:: __aiter__ |
| 57 | +
|
| 58 | +.. .. automethod:: recv |
| 59 | +
|
| 60 | +.. .. automethod:: recv_streaming |
| 61 | +
|
| 62 | +.. .. automethod:: send |
| 63 | +
|
| 64 | +.. .. automethod:: close |
| 65 | +
|
| 66 | +.. .. automethod:: wait_closed |
| 67 | +
|
| 68 | +.. .. automethod:: ping |
| 69 | +
|
| 70 | +.. .. automethod:: pong |
| 71 | +
|
| 72 | +.. .. automethod:: respond |
| 73 | +
|
| 74 | +.. WebSocket connection objects also provide these attributes: |
| 75 | +
|
| 76 | +.. .. autoattribute:: id |
| 77 | +
|
| 78 | +.. .. autoattribute:: logger |
| 79 | +
|
| 80 | +.. .. autoproperty:: local_address |
| 81 | +
|
| 82 | +.. .. autoproperty:: remote_address |
| 83 | +
|
| 84 | +.. .. autoattribute:: latency |
| 85 | +
|
| 86 | +.. .. autoproperty:: state |
| 87 | +
|
| 88 | +.. The following attributes are available after the opening handshake, |
| 89 | +.. once the WebSocket connection is open: |
| 90 | +
|
| 91 | +.. .. autoattribute:: request |
| 92 | +
|
| 93 | +.. .. autoattribute:: response |
| 94 | +
|
| 95 | +.. .. autoproperty:: subprotocol |
| 96 | +
|
| 97 | +.. The following attributes are available after the closing handshake, |
| 98 | +.. once the WebSocket connection is closed: |
| 99 | +
|
| 100 | +.. .. autoproperty:: close_code |
| 101 | +
|
| 102 | +.. .. autoproperty:: close_reason |
| 103 | +
|
| 104 | +.. HTTP Basic Authentication |
| 105 | +.. ------------------------- |
| 106 | +
|
| 107 | +.. websockets supports HTTP Basic Authentication according to |
| 108 | +.. :rfc:`7235` and :rfc:`7617`. |
| 109 | +
|
| 110 | +.. .. autofunction:: basic_auth |
0 commit comments