Need advice on implementing alternate upstream protocol

Valery Kholodkov valery+nginxen at
Mon Oct 3 08:59:24 UTC 2011

----- J.Q. S. <q2011oct at> wrote:
> I could use some advice on how best to proceed -
> I am exploring the idea of using a datagram protocol to broadcast http-like
> requests to a cluster of backend servers, where one of the servers will
> respond with either a small payload to send directly to the browser or a
> pointer to a network device where a file can be read and sent back. I won't
> know which server will respond, responses could come back in a different
> order then I send them, and each worker would have a single datagram socket
> for receiving responses to queries from the same worker.
> The most significant question I need to answer, would it be better to try
> and do this within the upstream/proxy framework nginx provides, or to do an
> independent module.

For datagram protocol it's better to do this outside of the upstream/proxy framework, as most of that code you don't need. 

> If working with upstream/proxy, I could use some advice on where to hook in
> my datagram connect/send/receive functions.
> If an independent module, any advice other then maybe looking at
> ngx_resolver and maybe the fastcgi module as starting points?

For UDP stuff look at udplog module sources:

Valery Kholodkov

More information about the nginx-devel mailing list