GithubHelp home page GithubHelp logo

nginx_mqtt_preread_module's Introduction

Nginx Stream Pre-read MQTT Module

Nginx module for reading "client" from a stream connection using MQTT protocol.

Build

Build Status

auto/configure --add-module=/path/to/nginx_mqtt_preread_module --with-stream

Configuration

Sample configuration

stream {

      log_format basic '$remote_addr [$time_local] '
                 'clientid: [$mqtt_preread_clientid]  username: [$mqtt_preread_username] '
                 'password: [$mqtt_preread_password] '
                 'protocol: [$mqtt_preread_protocol_name]  version: [$mqtt_preread_protocol_version] ';

      access_log /root/install/nginx/logs/nginx-access.log basic;
      mqtt_preread on;

      upstream backend {
          hash $mqtt_preread_clientid;

          server 10.0.0.7:1883; # upstream mqtt broker 1
          server 10.0.0.8:1883; # upstream mqtt broker 2
          server 10.0.0.9:1883; # upstream mqtt broker 3
      }

      server {
          listen 2883;
          proxy_pass backend;
          proxy_connect_timeout 1s;
      }
}

Configuration directives

mqtt_preread

  • syntax : mqtt_preread on|off;
  • default: mqtt_preread off;
  • context: stream, server

Enables extracting information from the MQTT CONNECT message at the preread phase.

Embedded Variables

  • $mqtt_preread_clientid - the clientid value from the CONNECT message
  • $mqtt_preread_username - the username value from the CONNECT message
  • $mqtt_preread_password - the password value from the CONNECT message
  • $mqtt_preread_protocol_name - the protocol name value from the CONNECT message
  • $mqtt_preread_protocol_version - the protocol version value from the CONNECT message

nginx_mqtt_preread_module's People

Contributors

weida avatar

Stargazers

Georgy Shelkovy avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.