|
| 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 | +.. currentmodule:: websockets.trio.server |
| 13 | + |
| 14 | +Running a server |
| 15 | +---------------- |
| 16 | + |
| 17 | +.. autoclass:: Server |
| 18 | + |
| 19 | + .. autoattribute:: connections |
| 20 | + |
| 21 | + .. automethod:: aclose |
| 22 | + |
| 23 | + .. autoattribute:: listeners |
| 24 | + |
| 25 | +Using a connection |
| 26 | +------------------ |
| 27 | + |
| 28 | +.. autoclass:: ServerConnection |
| 29 | + |
| 30 | + .. automethod:: __aiter__ |
| 31 | + |
| 32 | + .. automethod:: recv |
| 33 | + |
| 34 | + .. automethod:: recv_streaming |
| 35 | + |
| 36 | + .. automethod:: send |
| 37 | + |
| 38 | + .. automethod:: aclose |
| 39 | + |
| 40 | + .. automethod:: wait_closed |
| 41 | + |
| 42 | + .. automethod:: ping |
| 43 | + |
| 44 | + .. automethod:: pong |
| 45 | + |
| 46 | + .. automethod:: respond |
| 47 | + |
| 48 | + WebSocket connection objects also provide these attributes: |
| 49 | + |
| 50 | + .. autoattribute:: id |
| 51 | + |
| 52 | + .. autoattribute:: logger |
| 53 | + |
| 54 | + .. autoproperty:: local_address |
| 55 | + |
| 56 | + .. autoproperty:: remote_address |
| 57 | + |
| 58 | + .. autoattribute:: latency |
| 59 | + |
| 60 | + .. autoproperty:: state |
| 61 | + |
| 62 | + The following attributes are available after the opening handshake, |
| 63 | + once the WebSocket connection is open: |
| 64 | + |
| 65 | + .. autoattribute:: request |
| 66 | + |
| 67 | + .. autoattribute:: response |
| 68 | + |
| 69 | + .. autoproperty:: subprotocol |
| 70 | + |
| 71 | + The following attributes are available after the closing handshake, |
| 72 | + once the WebSocket connection is closed: |
| 73 | + |
| 74 | + .. autoproperty:: close_code |
| 75 | + |
| 76 | + .. autoproperty:: close_reason |
| 77 | + |
| 78 | +HTTP Basic Authentication |
| 79 | +------------------------- |
| 80 | + |
| 81 | +websockets supports HTTP Basic Authentication according to |
| 82 | +:rfc:`7235` and :rfc:`7617`. |
| 83 | + |
| 84 | +.. autofunction:: basic_auth |
0 commit comments