listeners.wss.conf.example 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ##--------------------------------------------------------------------
  2. ## WSS Listener
  3. ##
  4. ## Add a WSS Listener
  5. ##--------------------------------------------------------------------
  6. ## Note: This is an example of how to configure this feature
  7. ## you should copy and paste the below data into the emqx.conf for working
  8. ## The WSS listener supports all the fields listed in listeners.ws.conf.example
  9. ## only the WSS-specific fields are shown here
  10. ## Note: Modifying the 'wssname' to what you need
  11. listeners.wss.wssname {
  12. ## Port or Address to listen on, 0 means disable
  13. bind = 8084 ## or with an IP, e.g. "127.0.0.1:8084"
  14. enabled = true
  15. enable_authn = true
  16. max_connections = infinity
  17. proxy_protocol = false
  18. proxy_protocol_timeout = 3s
  19. mountpoint = ""
  20. tcp_options {
  21. active_n = 100
  22. backlog = 1024
  23. buffer = 4KB
  24. high_watermark = 1MB
  25. keepalive = none
  26. nodelay = true
  27. reuseaddr = true
  28. send_timeout = 15s
  29. send_timeout_close = true
  30. }
  31. websocket {
  32. allow_origin_absence = true
  33. check_origin_enable = false
  34. check_origins = "http://localhost:18083, http://127.0.0.1:18083"
  35. compress = false
  36. deflate_opts {
  37. client_context_takeover = "takeover"
  38. client_max_window_bits = 15
  39. mem_level = 8
  40. server_context_takeover = "takeover"
  41. server_max_window_bits = 15
  42. strategy = "default"
  43. }
  44. fail_if_no_subprotocol = true
  45. idle_timeout = "7200s"
  46. max_frame_size = "infinity"
  47. mqtt_path = "/mqtt"
  48. mqtt_piggyback = "multiple"
  49. proxy_address_header = "x-forwarded-for"
  50. proxy_port_header = "x-forwarded-port"
  51. supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
  52. }
  53. ssl_options {
  54. ## Trusted PEM format CA certificates bundle file
  55. cacertfile = "data/certs/cacert.pem"
  56. ## PEM format certificates chain file
  57. certfile = "data/certs/cert.pem"
  58. ## PEM format private key file
  59. keyfile = "data/certs/key.pem"
  60. ## Enable or disable peer verification
  61. verify = verify_none ## use verify_peer to enable
  62. ## if `verify' is enabled, whit true, the connection fails if the client does not have a certificate to send
  63. fail_if_no_peer_cert = false
  64. ## Enable TLS session reuse
  65. reuse_sessions = true
  66. ## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
  67. depth = 10
  68. ## Which versions are to be supported
  69. versions = [tlsv1.3, tlsv1.2]
  70. ## TLS cipher suite names
  71. ## Note: By default, all available suites are supported, you do not need to set this
  72. ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
  73. ## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
  74. secure_renegotiate = true
  75. ## Log level for SSL communication
  76. ## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
  77. log_level = notice
  78. ## Hibernate the SSL process after idling for amount of time reducing its memory footprint
  79. hibernate_after = 5s
  80. ## Forces the cipher to be set based on the server-specified order instead of the client-specified order
  81. honor_cipher_order = true
  82. ## Setting this to false to disable client-initiated renegotiation
  83. client_renegotiation = true
  84. ## Maximum time duration allowed for the handshake to complete
  85. handshake_timeout = 15s
  86. }
  87. }