Home  >  Q&A  >  body text

Server side - how nginx handles data uploaded via udp protocol

I have always used the http protocol. I recently received a device. The device sends data to the server through the udp protocol. However, because I have never used the udp protocol, I don’t know how to deal with it.
I would like to ask, if the data is transmitted through the udp protocol, for example, the port is 123, is there a configuration file similar to conf, which records the processing program corresponding to the data transmitted through the udp transmission protocol with port 123? , and call the handler to process the data through the corresponding configuration path.
Or there is no conf file but there is a special path. Under this path are all programs that process the udp protocol. After the server receives the udp protocol, it goes one by one. Check. When the corresponding port is found, call

directly.
我想大声告诉你我想大声告诉你2714 days ago535

reply all(1)I'll reply

  • 某草草

    某草草2017-05-16 17:11:42

    Nginx after 1.9 adds a stream module to support tcp and udp connections

    stream {
        server {
            listen 12345;
            ...
        }
        server {
            listen 53 udp;
            ...
        }
        ...
    }

    reply
    0
  • Cancelreply