github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/docs/protocol.md (about)

     1  # protocols
     2  
     3  can generate protocols template at web page `GEOUP -> Add New Node`  
     4  protocol is stratification model, that will process data by protocols order  
     5  
     6  for example socks5 client  
     7  
     8  wee need a outbound protocol or dialer(tcp,udp dialer), such as simple(simple write data to host:port or with tls)
     9  
    10  ```json
    11  {
    12   "simple": {
    13    "host": "127.0.0.1",
    14    "port": 1080,
    15    "packet_conn_direct": true, // udp data write to host:port or origin address
    16    "tls_config": {
    17     "enable": false,
    18     "server_name": "",
    19     "ca_cert": [
    20      "AAE="
    21     ],
    22     "insecure_skip_verify": false,
    23     "next_protos": []
    24    }
    25   }
    26  }
    27  ```
    28  
    29  socks5 protocol, that will wrap or unwrap with sock5 protocol
    30  
    31  ```json
    32  {
    33   "socks5": {
    34    "hostname": "127.0.0.1",
    35    "user": "",
    36    "password": ""
    37   }
    38  }
    39  ```
    40  
    41  so a complete protocols config is
    42  
    43  ```json
    44  {
    45   "hash": "",
    46   "name": "new node",
    47   "group": "template group",
    48   "origin": "manual",
    49   "protocols": [ // <-----------
    50    {
    51     "simple": {
    52      "host": "127.0.0.1",
    53      "port": 1080,
    54      "packet_conn_direct": false,
    55      "tls_config": {
    56       "enable": false,
    57       "server_name": "",
    58       "ca_cert": [],
    59       "insecure_skip_verify": false,
    60       "next_protos": []
    61      }
    62     }
    63    },
    64    {
    65     "socks5": {
    66      "hostname": "127.0.0.1",
    67      "user": "",
    68      "password": ""
    69     }
    70    }
    71   ]
    72  }
    73  ```
    74  
    75  another example that vmess protocol with websocket
    76  
    77  ```json
    78  {
    79   "hash": "",
    80   "name": "new node",
    81   "group": "template group",
    82   "origin": "manual",
    83   "protocols": [
    84    {
    85     "simple": { // outbound/dialer
    86      "host": "example.com",
    87      "port": 50051,
    88      "packet_conn_direct": false
    89     }
    90    },
    91    {
    92     "websocket": { // websocket protocol
    93      "host": "websocket.example.com",
    94      "path": "/query",
    95      "tls": {
    96       "enable": true,
    97       "server_name": "websocket.example.com",
    98       "ca_cert": [],
    99       "insecure_skip_verify": false,
   100       "next_protos": []
   101      }
   102     }
   103    },
   104    {
   105     "vmess": { // vmess protocol
   106      "id": "e014f7ea-3350-4141-9b2c-0cc1b4fd8c22",
   107      "aid": "0",
   108      "security": "auto"
   109     }
   110    }
   111   ]
   112  }
   113  ```