Adding a fd that is not obtained through accept to the list the active connections
mdounin at mdounin.ru
Fri Aug 27 15:40:56 UTC 2021
On Fri, Aug 27, 2021 at 01:59:03PM +0200, Ottavio Campana wrote:
> Dear Phillip,
> I know Tailscale very well, I use it and like it a lot. But my final goal
> is finding a way to implement the ONVIF Uplink service,
> https://www.onvif.org/specs/srv/uplink/ONVIF-Uplink-Spec.pdf , where I can
> have several devices on the LAN that need to connect to a remote server,
> which will then send commands.
> Therefore I need a way to start a connection from nginx (or an external
> program and then passing the fd through a unix socket domain) and make it
> act as if the fd were obtained from an accept.
> Nginx works with events and I find it very difficult to find a mechanism to
> pass this connection to it.
> Do you have other ideas?
The most simple solution I can think of is to open two
connections: to your command endpoint and to nginx, and proxy
everything once the connections are established.
More information about the nginx-devel