github.com/sagernet/sing-box@v1.9.0-rc.20/docs/configuration/shared/udp-over-tcp.md (about)

     1  # UDP over TCP
     2  
     3  !!! warning ""
     4  
     5      It's a proprietary protocol created by SagerNet, not part of shadowsocks.
     6  
     7  The UDP over TCP protocol is used to transmit UDP packets in TCP.
     8  
     9  ### Structure
    10  
    11  ```json
    12  {
    13    "enabled": true,
    14    "version": 2
    15  }
    16  ```
    17  
    18  !!! info ""
    19  
    20      The structure can be replaced with a boolean value when the version is not specified.
    21  
    22  ### Fields
    23  
    24  #### enabled
    25  
    26  Enable the UDP over TCP protocol.
    27  
    28  #### version
    29  
    30  The protocol version, `1` or `2`.
    31  
    32  2 is used by default.
    33  
    34  ### Application support
    35  
    36  | Project      | UoT v1               | UoT v2                                                                                                            |
    37  |--------------|----------------------|-------------------------------------------------------------------------------------------------------------------|
    38  | sing-box     | v0 (2022/08/11)      | v1.2-beta9                                                                                                        |
    39  | Xray-core    | v1.5.7 (2022/06/05)  | [f57ec13](https://github.com/XTLS/Xray-core/commit/f57ec1388084df041a2289bacab14e446bf1b357) (Not released)       |
    40  | Clash.Meta   | v1.12.0 (2022/07/02) | [8cb67b6](https://github.com/MetaCubeX/Clash.Meta/commit/8cb67b6480649edfa45dcc9ac89ce0789651e8b3) (Not released) |
    41  | Shadowrocket | v2.2.12 (2022/08/13) | /                                                                                                                 |
    42  
    43  ### Protocol details
    44  
    45  #### Protocol version 1
    46  
    47  The client requests the magic address to the upper layer proxy protocol to indicate the request: `sp.udp-over-tcp.arpa`
    48  
    49  #### Stream format
    50  
    51  | ATYP | address  | port  | length | data     |
    52  |------|----------|-------|--------|----------|
    53  | u8   | variable | u16be | u16be  | variable |
    54  
    55  **ATYP / address / port**: Uses the SOCKS address format.
    56  
    57  #### Protocol version 2
    58  
    59  Protocol version 2 uses a new magic address: `sp.v2.udp-over-tcp.arpa`
    60  
    61  ##### Request format
    62  
    63  | isConnect | ATYP | address  | port  |
    64  |-----------|------|----------|-------|
    65  | u8        | u8   | variable | u16be |
    66  
    67  **isConnect**: Set to 1 to indicates that the stream uses the connect format, 0 to disable.
    68  
    69  **ATYP / address / port**: Request destination, uses the SOCKS address format.
    70  
    71  ##### Connect stream format
    72  
    73  | length | data     |
    74  |--------|----------|
    75  | u16be  | variable |
    76  
    77  ##### Non-connect stream format
    78  
    79  As the same as the stream format in protocol version 1.