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

     1  {
     2  	layer4 {
     3  		:443 {
     4  			@w1 winbox {
     5  				modes standard romon
     6  				username toms
     7  			}
     8  			route @w1 {
     9  				proxy 192.168.0.1:8291
    10  			}
    11  			@w2 winbox {
    12  				modes standard
    13  				username_regexp ^andris|edgars|juris$
    14  			}
    15  			route @w2 {
    16  				proxy 192.168.0.2:8291
    17  			}
    18  		}
    19  	}
    20  }
    21  ----------
    22  {
    23  	"apps": {
    24  		"layer4": {
    25  			"servers": {
    26  				"srv0": {
    27  					"listen": [
    28  						":443"
    29  					],
    30  					"routes": [
    31  						{
    32  							"match": [
    33  								{
    34  									"winbox": {
    35  										"modes": [
    36  											"standard",
    37  											"romon"
    38  										],
    39  										"username": "toms"
    40  									}
    41  								}
    42  							],
    43  							"handle": [
    44  								{
    45  									"handler": "proxy",
    46  									"upstreams": [
    47  										{
    48  											"dial": [
    49  												"192.168.0.1:8291"
    50  											]
    51  										}
    52  									]
    53  								}
    54  							]
    55  						},
    56  						{
    57  							"match": [
    58  								{
    59  									"winbox": {
    60  										"modes": [
    61  											"standard"
    62  										],
    63  										"username_regexp": "^andris|edgars|juris$"
    64  									}
    65  								}
    66  							],
    67  							"handle": [
    68  								{
    69  									"handler": "proxy",
    70  									"upstreams": [
    71  										{
    72  											"dial": [
    73  												"192.168.0.2:8291"
    74  											]
    75  										}
    76  									]
    77  								}
    78  							]
    79  						}
    80  					]
    81  				}
    82  			}
    83  		}
    84  	}
    85  }