<div dir="ltr"><div>Dear Phillip,</div><div><br></div><div>an ssh tunnel is not compatible with the specs of the ONVIF uplink service.</div><div><br></div><div>I understand that there is no "free lunch" to achieve this, thus I expect to have to write code. What is the suggested way to add a connection, by passing the fd of the connection to nginx before establishing the SSL context. Where could I hook up? How can I implement a fake listener that does not listen but connects to a remote server?<br></div><div><br></div><div>Thank you,</div><div><br></div><div>Ottavio<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 30 ago 2021 alle ore 13:24 Phillip Odam <<a href="mailto:phillip.odam@nitorgroup.com">phillip.odam@nitorgroup.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ottavio<div><br></div><div>There’s no solution just with nginx as it currently that I know of, to avoid the need for a port forward in the NAT router a simple solution would be to use a ssh tunnel - this does separate initial connection from subsequent requests as you’re unlikely to want to establish a new tunnel for each and every request and ‘knowledge’ the connection is established is no longer inherently part of the application making the HHTP request. So to simplify things you could just expect the ssh tunnel to be established as a precondition (once off initial setup)</div><div><br></div><div>Phillip<br><br>On Friday, August 27, 2021, Maxim Dounin <<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
On Fri, Aug 27, 2021 at 01:59:03PM +0200, Ottavio Campana wrote:<br>
<br>
> Dear Phillip,<br>
> <br>
> I know Tailscale very well, I use it and like it a lot. But my final goal<br>
> is finding a way to implement the ONVIF Uplink service,<br>
> <a href="https://www.onvif.org/specs/srv/uplink/ONVIF-Uplink-Spec.pdf" target="_blank">https://www.onvif.org/specs/srv/uplink/ONVIF-Uplink-Spec.pdf</a> , where I can<br>
> have several devices on the LAN that need to connect to a remote server,<br>
> which will then send commands.<br>
> <br>
> Therefore I need a way to start a connection from nginx (or an external<br>
> program and then passing the fd through a unix socket domain) and make it<br>
> act as if the fd were obtained from an accept.<br>
> <br>
> Nginx works with events and I find it very difficult to find a mechanism to<br>
> pass this connection to it.<br>
> <br>
> Do you have other ideas?<br>
<br>
The most simple solution I can think of is to open two <br>
connections: to your command endpoint and to nginx, and proxy <br>
everything once the connections are established.<br>
<br>
-- <br>
Maxim Dounin<br>
<a href="http://mdounin.ru/" target="_blank">http://mdounin.ru/</a><br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</blockquote></div>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Non c'è più forza nella normalità, c'è solo monotonia<br></div>