github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/websocket.md (about)

     1  ---
     2  title: websocket
     3  type: input
     4  status: stable
     5  categories: ["Network"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/input/websocket.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Connects to a websocket server and continuously receives messages.
    20  
    21  
    22  <Tabs defaultValue="common" values={[
    23    { label: 'Common', value: 'common', },
    24    { label: 'Advanced', value: 'advanced', },
    25  ]}>
    26  
    27  <TabItem value="common">
    28  
    29  ```yaml
    30  # Common config fields, showing default values
    31  input:
    32    label: ""
    33    websocket:
    34      url: ws://localhost:4195/get/ws
    35  ```
    36  
    37  </TabItem>
    38  <TabItem value="advanced">
    39  
    40  ```yaml
    41  # All config fields, showing default values
    42  input:
    43    label: ""
    44    websocket:
    45      url: ws://localhost:4195/get/ws
    46      open_message: ""
    47      tls:
    48        enabled: false
    49        skip_cert_verify: false
    50        enable_renegotiation: false
    51        root_cas: ""
    52        root_cas_file: ""
    53        client_certs: []
    54      oauth:
    55        enabled: false
    56        consumer_key: ""
    57        consumer_secret: ""
    58        access_token: ""
    59        access_token_secret: ""
    60        request_url: ""
    61      basic_auth:
    62        enabled: false
    63        username: ""
    64        password: ""
    65      jwt:
    66        enabled: false
    67        private_key_file: ""
    68        signing_method: ""
    69        claims: {}
    70  ```
    71  
    72  </TabItem>
    73  </Tabs>
    74  
    75  It is possible to configure an `open_message`, which when set to a
    76  non-empty string will be sent to the websocket server each time a connection is
    77  first established.
    78  
    79  ## Fields
    80  
    81  ### `url`
    82  
    83  The URL to connect to.
    84  
    85  
    86  Type: `string`  
    87  Default: `"ws://localhost:4195/get/ws"`  
    88  
    89  ```yaml
    90  # Examples
    91  
    92  url: ws://localhost:4195/get/ws
    93  ```
    94  
    95  ### `open_message`
    96  
    97  An optional message to send to the server upon connection.
    98  
    99  
   100  Type: `string`  
   101  Default: `""`  
   102  
   103  ### `tls`
   104  
   105  Custom TLS settings can be used to override system defaults.
   106  
   107  
   108  Type: `object`  
   109  
   110  ### `tls.enabled`
   111  
   112  Whether custom TLS settings are enabled.
   113  
   114  
   115  Type: `bool`  
   116  Default: `false`  
   117  
   118  ### `tls.skip_cert_verify`
   119  
   120  Whether to skip server side certificate verification.
   121  
   122  
   123  Type: `bool`  
   124  Default: `false`  
   125  
   126  ### `tls.enable_renegotiation`
   127  
   128  Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message `local error: tls: no renegotiation`.
   129  
   130  
   131  Type: `bool`  
   132  Default: `false`  
   133  Requires version 3.45.0 or newer  
   134  
   135  ### `tls.root_cas`
   136  
   137  An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
   138  
   139  
   140  Type: `string`  
   141  Default: `""`  
   142  
   143  ```yaml
   144  # Examples
   145  
   146  root_cas: |-
   147    -----BEGIN CERTIFICATE-----
   148    ...
   149    -----END CERTIFICATE-----
   150  ```
   151  
   152  ### `tls.root_cas_file`
   153  
   154  An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
   155  
   156  
   157  Type: `string`  
   158  Default: `""`  
   159  
   160  ```yaml
   161  # Examples
   162  
   163  root_cas_file: ./root_cas.pem
   164  ```
   165  
   166  ### `tls.client_certs`
   167  
   168  A list of client certificates to use. For each certificate either the fields `cert` and `key`, or `cert_file` and `key_file` should be specified, but not both.
   169  
   170  
   171  Type: `array`  
   172  Default: `[]`  
   173  
   174  ```yaml
   175  # Examples
   176  
   177  client_certs:
   178    - cert: foo
   179      key: bar
   180  
   181  client_certs:
   182    - cert_file: ./example.pem
   183      key_file: ./example.key
   184  ```
   185  
   186  ### `tls.client_certs[].cert`
   187  
   188  A plain text certificate to use.
   189  
   190  
   191  Type: `string`  
   192  Default: `""`  
   193  
   194  ### `tls.client_certs[].key`
   195  
   196  A plain text certificate key to use.
   197  
   198  
   199  Type: `string`  
   200  Default: `""`  
   201  
   202  ### `tls.client_certs[].cert_file`
   203  
   204  The path to a certificate to use.
   205  
   206  
   207  Type: `string`  
   208  Default: `""`  
   209  
   210  ### `tls.client_certs[].key_file`
   211  
   212  The path of a certificate key to use.
   213  
   214  
   215  Type: `string`  
   216  Default: `""`  
   217  
   218  ### `oauth`
   219  
   220  Allows you to specify open authentication via OAuth version 1.
   221  
   222  
   223  Type: `object`  
   224  
   225  ### `oauth.enabled`
   226  
   227  Whether to use OAuth version 1 in requests.
   228  
   229  
   230  Type: `bool`  
   231  Default: `false`  
   232  
   233  ### `oauth.consumer_key`
   234  
   235  A value used to identify the client to the service provider.
   236  
   237  
   238  Type: `string`  
   239  Default: `""`  
   240  
   241  ### `oauth.consumer_secret`
   242  
   243  A secret used to establish ownership of the consumer key.
   244  
   245  
   246  Type: `string`  
   247  Default: `""`  
   248  
   249  ### `oauth.access_token`
   250  
   251  A value used to gain access to the protected resources on behalf of the user.
   252  
   253  
   254  Type: `string`  
   255  Default: `""`  
   256  
   257  ### `oauth.access_token_secret`
   258  
   259  A secret provided in order to establish ownership of a given access token.
   260  
   261  
   262  Type: `string`  
   263  Default: `""`  
   264  
   265  ### `oauth.request_url`
   266  
   267  The URL of the OAuth provider.
   268  
   269  
   270  Type: `string`  
   271  Default: `""`  
   272  
   273  ### `basic_auth`
   274  
   275  Allows you to specify basic authentication.
   276  
   277  
   278  Type: `object`  
   279  
   280  ### `basic_auth.enabled`
   281  
   282  Whether to use basic authentication in requests.
   283  
   284  
   285  Type: `bool`  
   286  Default: `false`  
   287  
   288  ### `basic_auth.username`
   289  
   290  A username to authenticate as.
   291  
   292  
   293  Type: `string`  
   294  Default: `""`  
   295  
   296  ### `basic_auth.password`
   297  
   298  A password to authenticate with.
   299  
   300  
   301  Type: `string`  
   302  Default: `""`  
   303  
   304  ### `jwt`
   305  
   306  BETA: Allows you to specify JWT authentication.
   307  
   308  
   309  Type: `object`  
   310  
   311  ### `jwt.enabled`
   312  
   313  Whether to use JWT authentication in requests.
   314  
   315  
   316  Type: `bool`  
   317  Default: `false`  
   318  
   319  ### `jwt.private_key_file`
   320  
   321  A file with the PEM encoded via PKCS1 or PKCS8 as private key.
   322  
   323  
   324  Type: `string`  
   325  Default: `""`  
   326  
   327  ### `jwt.signing_method`
   328  
   329  A method used to sign the token such as RS256, RS384 or RS512.
   330  
   331  
   332  Type: `string`  
   333  Default: `""`  
   334  
   335  ### `jwt.claims`
   336  
   337  A value used to identify the claims that issued the JWT.
   338  
   339  
   340  Type: `object`  
   341  Default: `{}`  
   342  
   343