github.com/sagernet/sing-box@v1.2.7/docs/configuration/shared/listen.md (about)

     1  ### Structure
     2  
     3  ```json
     4  {
     5    "listen": "::",
     6    "listen_port": 5353,
     7    "tcp_fast_open": false,
     8    "udp_fragment": false,
     9    "sniff": false,
    10    "sniff_override_destination": false,
    11    "sniff_timeout": "300ms",
    12    "domain_strategy": "prefer_ipv6",
    13    "udp_timeout": 300,
    14    "proxy_protocol": false,
    15    "proxy_protocol_accept_no_header": false,
    16    "detour": "another-in"
    17  }
    18  ```
    19  
    20  ### Fields
    21  
    22  | Field                             | Available Context                                                 |
    23  |-----------------------------------|-------------------------------------------------------------------|
    24  | `listen`                          | Needs to listen on TCP or UDP.                                    |
    25  | `listen_port`                     | Needs to listen on TCP or UDP.                                    |
    26  | `tcp_fast_open`                   | Needs to listen on TCP.                                           |
    27  | `udp_timeout`                     | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
    28  | `proxy_protocol`                  | Needs to listen on TCP.                                           |
    29  | `proxy_protocol_accept_no_header` | When `proxy_protocol` enabled                                     |
    30  
    31  #### listen
    32  
    33  ==Required==
    34  
    35  Listen address.
    36  
    37  #### listen_port
    38  
    39  Listen port.
    40  
    41  #### tcp_fast_open
    42  
    43  Enable TCP Fast Open.
    44  
    45  #### udp_fragment
    46  
    47  Enable UDP fragmentation.
    48  
    49  #### sniff
    50  
    51  Enable sniffing.
    52  
    53  See [Protocol Sniff](/configuration/route/sniff/) for details.
    54  
    55  #### sniff_override_destination
    56  
    57  Override the connection destination address with the sniffed domain.
    58  
    59  If the domain name is invalid (like tor), this will not work.
    60  
    61  #### sniff_timeout
    62  
    63  Timeout for sniffing.
    64  
    65  300ms is used by default.
    66  
    67  #### domain_strategy
    68  
    69  One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
    70  
    71  If set, the requested domain name will be resolved to IP before routing.
    72  
    73  If `sniff_override_destination` is in effect, its value will be taken as a fallback.
    74  
    75  #### udp_timeout
    76  
    77  UDP NAT expiration time in seconds, default is 300 (5 minutes).
    78  
    79  #### proxy_protocol
    80  
    81  Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
    82  
    83  #### proxy_protocol_accept_no_header
    84  
    85  Accept connections without Proxy Protocol header.
    86  
    87  #### detour
    88  
    89  If set, connections will be forwarded to the specified inbound.
    90  
    91  Requires target inbound support, see [Injectable](/configuration/inbound/#fields).