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

     1  {
     2  	layer4 {
     3  		:443 {
     4  			@ch_jacob rdp {
     5  				cookie_hash jacob
     6  			}
     7  			@ci_jacob rdp {
     8  				custom_info_regexp ^(.*)jacob$
     9  			}
    10  			route @ch_jacob @ci_jacob {
    11  				proxy jacob.machine.local:3389
    12  			}
    13  			@ch_sarah rdp {
    14  				cookie_hash sarah
    15  			}
    16  			@ci_sarah rdp {
    17  				custom_info_regexp ^(.*)sarah$
    18  			}
    19  			route @ch_sarah @ci_sarah {
    20  				proxy sarah.machine.local:3389
    21  			}
    22  			route {
    23  				proxy fallback.machine.local:443
    24  			}
    25  		}
    26  	}
    27  }
    28  ----------
    29  {
    30  	"apps": {
    31  		"layer4": {
    32  			"servers": {
    33  				"srv0": {
    34  					"listen": [
    35  						":443"
    36  					],
    37  					"routes": [
    38  						{
    39  							"match": [
    40  								{
    41  									"rdp": {
    42  										"cookie_hash": "jacob"
    43  									}
    44  								},
    45  								{
    46  									"rdp": {
    47  										"custom_info_regexp": "^(.*)jacob$"
    48  									}
    49  								}
    50  							],
    51  							"handle": [
    52  								{
    53  									"handler": "proxy",
    54  									"upstreams": [
    55  										{
    56  											"dial": [
    57  												"jacob.machine.local:3389"
    58  											]
    59  										}
    60  									]
    61  								}
    62  							]
    63  						},
    64  						{
    65  							"match": [
    66  								{
    67  									"rdp": {
    68  										"cookie_hash": "sarah"
    69  									}
    70  								},
    71  								{
    72  									"rdp": {
    73  										"custom_info_regexp": "^(.*)sarah$"
    74  									}
    75  								}
    76  							],
    77  							"handle": [
    78  								{
    79  									"handler": "proxy",
    80  									"upstreams": [
    81  										{
    82  											"dial": [
    83  												"sarah.machine.local:3389"
    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  }