github.com/sagernet/sing-box@v1.9.0-rc.20/docs/configuration/shared/listen.md (about) 1 ### Structure 2 3 ```json 4 { 5 "listen": "::", 6 "listen_port": 5353, 7 "tcp_fast_open": false, 8 "tcp_multi_path": false, 9 "udp_fragment": false, 10 "udp_timeout": "5m", 11 "detour": "another-in", 12 "sniff": false, 13 "sniff_override_destination": false, 14 "sniff_timeout": "300ms", 15 "domain_strategy": "prefer_ipv6", 16 "udp_disable_domain_unmapping": false 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 | `tcp_multi_path` | Needs to listen on TCP. | 28 | `udp_timeout` | Needs to assemble UDP connections. | 29 | `udp_disable_domain_unmapping` | Needs to listen on UDP and accept domain UDP addresses. | 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 #### tcp_multi_path 46 47 !!! warning "" 48 49 Go 1.21 required. 50 51 Enable TCP Multi Path. 52 53 #### udp_fragment 54 55 Enable UDP fragmentation. 56 57 #### udp_timeout 58 59 UDP NAT expiration time in seconds. 60 61 `5m` is used by default. 62 63 #### detour 64 65 If set, connections will be forwarded to the specified inbound. 66 67 Requires target inbound support, see [Injectable](/configuration/inbound/#fields). 68 69 #### sniff 70 71 Enable sniffing. 72 73 See [Protocol Sniff](/configuration/route/sniff/) for details. 74 75 #### sniff_override_destination 76 77 Override the connection destination address with the sniffed domain. 78 79 If the domain name is invalid (like tor), this will not work. 80 81 #### sniff_timeout 82 83 Timeout for sniffing. 84 85 300ms is used by default. 86 87 #### domain_strategy 88 89 One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`. 90 91 If set, the requested domain name will be resolved to IP before routing. 92 93 If `sniff_override_destination` is in effect, its value will be taken as a fallback. 94 95 #### udp_disable_domain_unmapping 96 97 If enabled, for UDP proxy requests addressed to a domain, 98 the original packet address will be sent in the response instead of the mapped domain. 99 100 This option is used for compatibility with clients that 101 do not support receiving UDP packets with domain addresses, such as Surge.