github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/docs/configuration/inbound/shadowsocks.md (about)

     1  ### Structure
     2  
     3  ```json
     4  {
     5    "type": "shadowsocks",
     6    "tag": "ss-in",
     7  
     8    ... // Listen Fields
     9  
    10    "method": "2022-blake3-aes-128-gcm",
    11    "password": "8JCsPssfgS8tiRwiMlhARg=="
    12  }
    13  ```
    14  
    15  ### Multi-User Structure
    16  
    17  ```json
    18  {
    19    "method": "2022-blake3-aes-128-gcm",
    20    "password": "8JCsPssfgS8tiRwiMlhARg==",
    21    "users": [
    22      {
    23        "name": "sekai",
    24        "password": "PCD2Z4o12bKUoFa3cC97Hw=="
    25      }
    26    ]
    27  }
    28  ```
    29  
    30  ### Relay Structure
    31  
    32  ```json
    33  {
    34    "type": "shadowsocks",
    35    "method": "2022-blake3-aes-128-gcm",
    36    "password": "8JCsPssfgS8tiRwiMlhARg==",
    37    "destinations": [
    38      {
    39        "name": "test",
    40        "server": "example.com",
    41        "server_port": 8080,
    42        "password": "PCD2Z4o12bKUoFa3cC97Hw=="
    43      }
    44    ]
    45  }
    46  ```
    47  
    48  ### Listen Fields
    49  
    50  See [Listen Fields](/configuration/shared/listen) for details.
    51  
    52  ### Fields
    53  
    54  #### network
    55  
    56  Listen network, one of `tcp` `udp`.
    57  
    58  Both if empty.
    59  
    60  #### method
    61  
    62  ==Required==
    63  
    64  | Method                        | Key Length |
    65  |-------------------------------|------------|
    66  | 2022-blake3-aes-128-gcm       | 16         |
    67  | 2022-blake3-aes-256-gcm       | 32         |
    68  | 2022-blake3-chacha20-poly1305 | 32         |
    69  | none                          | /          |
    70  | aes-128-gcm                   | /          |
    71  | aes-192-gcm                   | /          |
    72  | aes-256-gcm                   | /          |
    73  | chacha20-ietf-poly1305        | /          |
    74  | xchacha20-ietf-poly1305       | /          |
    75  
    76  #### password
    77  
    78  ==Required==
    79  
    80  | Method        | Password Format                                |
    81  |---------------|------------------------------------------------|
    82  | none          | /                                              |
    83  | 2022 methods  | `sing-box generate rand --base64 <Key Length>` |
    84  | other methods | any string                                     |
    85  
    86  ### Listen Fields
    87  
    88  #### listen
    89  
    90  ==Required==
    91  
    92  Listen address.
    93  
    94  #### listen_port
    95  
    96  ==Required==
    97  
    98  Listen port.
    99  
   100  #### tcp_fast_open
   101  
   102  Enable tcp fast open for listener.
   103  
   104  #### sniff
   105  
   106  Enable sniffing.
   107  
   108  See [Protocol Sniff](/configuration/route/sniff/) for details.
   109  
   110  #### sniff_override_destination
   111  
   112  Override the connection destination address with the sniffed domain.
   113  
   114  If the domain name is invalid (like tor), this will not work.
   115  
   116  #### domain_strategy
   117  
   118  One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
   119  
   120  If set, the requested domain name will be resolved to IP before routing.
   121  
   122  If `sniff_override_destination` is in effect, its value will be taken as a fallback.
   123  
   124  #### udp_timeout
   125  
   126  UDP NAT expiration time in seconds, default is 300 (5 minutes).
   127  
   128  #### proxy_protocol
   129  
   130  Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.