github.com/mholt/caddy-l4@v0.0.0-20241104153248-ec8fae209322/integration/caddyfile_adapt/gd_matcher_socks.caddytest (about)

     1  {
     2  	layer4 {
     3  		:443 {
     4  			@s4 socks4 {
     5  				commands BIND GET
     6  				networks 10.0.0.0/8 fc::/7
     7  				ports 443 1080
     8  			}
     9  			route @s4 {
    10  				proxy socks4.machine.local:1080
    11  			}
    12  			@s5 socks5 {
    13  				auth_methods 1 2
    14  			}
    15  			route @s5 {
    16  				proxy socks5.machine.local:1080
    17  			}
    18  			route {
    19  				proxy fallback.machine.local:443
    20  			}
    21  		}
    22  	}
    23  }
    24  ----------
    25  {
    26  	"apps": {
    27  		"layer4": {
    28  			"servers": {
    29  				"srv0": {
    30  					"listen": [
    31  						":443"
    32  					],
    33  					"routes": [
    34  						{
    35  							"match": [
    36  								{
    37  									"socks4": {
    38  										"commands": [
    39  											"BIND",
    40  											"GET"
    41  										],
    42  										"networks": [
    43  											"10.0.0.0/8",
    44  											"fc::/7"
    45  										],
    46  										"ports": [
    47  											443,
    48  											1080
    49  										]
    50  									}
    51  								}
    52  							],
    53  							"handle": [
    54  								{
    55  									"handler": "proxy",
    56  									"upstreams": [
    57  										{
    58  											"dial": [
    59  												"socks4.machine.local:1080"
    60  											]
    61  										}
    62  									]
    63  								}
    64  							]
    65  						},
    66  						{
    67  							"match": [
    68  								{
    69  									"socks5": {
    70  										"auth_methods": [
    71  											1,
    72  											2
    73  										]
    74  									}
    75  								}
    76  							],
    77  							"handle": [
    78  								{
    79  									"handler": "proxy",
    80  									"upstreams": [
    81  										{
    82  											"dial": [
    83  												"socks5.machine.local:1080"
    84  											]
    85  										}
    86  									]
    87  								}
    88  							]
    89  						},
    90  						{
    91  							"handle": [
    92  								{
    93  									"handler": "proxy",
    94  									"upstreams": [
    95  										{
    96  											"dial": [
    97  												"fallback.machine.local:443"
    98  											]
    99  										}
   100  									]
   101  								}
   102  							]
   103  						}
   104  					]
   105  				}
   106  			}
   107  		}
   108  	}
   109  }