github.com/google/cloudprober@v0.11.3/docs/content/how-to/built-in-servers.md (about)

     1  ---
     2  menu:
     3      main:
     4          parent: "How-Tos"
     5          weight: 27
     6  title: "Built-in Servers"
     7  date: 2019-10-11T17:48:13-05:00
     8  ---
     9  Cloudprober has a few built in servers. This is useful when you are probing that
    10  a connection is working, or as a baseline to compare the probing results from
    11  your actual service to.
    12  
    13  ## HTTP
    14  
    15  {{< highlight shell >}}
    16  server {
    17    type: HTTP
    18    http_server {
    19      port: 8080
    20    }
    21  }
    22  {{< / highlight >}}
    23  
    24  This creates an HTTP server that responds on port `8080`. By default it will
    25  respond to the following endpoints:
    26  
    27  * `/healthcheck`
    28  * `/lameduck`
    29  
    30  {{< highlight shell >}}
    31  server {
    32    type: HTTP
    33    http_server {
    34      port: 8080
    35      pattern_data_handler {
    36        response_size: 1024
    37      }
    38      pattern_data_handler {
    39        response_size: 4
    40        pattern: "four"
    41      }
    42    }
    43  }
    44  {{< / highlight >}}
    45  
    46  This adds two endpoints to the HTTP server:
    47  
    48  *   `/data_1024` which responds with 1024 bytes of
    49      `cloudprobercloudprobercloudprober`.
    50  *   `/data_4` which responds with `four`.
    51  
    52  See
    53  [servers/http/proto/config.go](https://github.com/google/cloudprober/blob/master/servers/http/proto/config.proto)
    54  for all HTTP server configuration options.
    55  
    56  ## UDP
    57  
    58  A Cloudprober UDP server can be configured to either echo or discard packets it
    59  receives.
    60  
    61  {{< highlight shell >}}
    62  server {
    63    type: UDP
    64    udp_server {
    65      port: 85
    66      type: ECHO
    67    }
    68  }
    69  
    70  server {
    71    type: UDP
    72    udp_server {
    73      port: 90
    74      type: DISCARD
    75    }
    76  }
    77  {{< / highlight >}}
    78  
    79  See
    80  [servers/udp/proto/config.go](https://github.com/google/cloudprober/blob/master/servers/udp/proto/config.proto)
    81  for all UDP server configuration options.
    82  
    83  ## GRPC
    84  
    85  See
    86  [servers/grpc/proto/config.go](https://github.com/google/cloudprober/blob/master/servers/grpc/proto/config.proto)
    87  for all GRPC server configuration options.