Welcome! Log In Create A New Profile

Advanced

Re: Module connecting outside

Antonio Nappa
March 21, 2017 09:44AM
Hello,

By checking the ngx_http_upstream I don't see any kind of handling in case
the ngx_ssl_handshake returns NGX_ERROR, I am trying to catch this error in
order to handle network outages and subsequent reconnections attempts from
my module. Do you think this could be a good way to trigger reconnection
timer? At the moment I am handling reconnections also in the read and write
events when if(wev->timedout || c->error || c->close).

Thanks
Antonio

2017-03-09 14:16 GMT+01:00 Maxim Dounin <mdounin@mdounin.ru>:

> Hello!
>
> On Wed, Mar 08, 2017 at 08:10:25PM +0100, Antonio Nappa wrote:
>
> > I am in the process of creating a module that connects to the outside to
> > exchange data with another service, I am taking as inspiration the
> > mail_module and the upstream module, basically my module is connecting
> > using the ngx_event_connect_peer and handling the read and write events
> > properly. I have 2 questions:
> >
> > Is this the proper way to make a module connecting to the outside?
>
> Yes.
>
> > Would it be possible to use nginx primitives to connect through SSL?
>
> To connect through SSL you sill have to use
> ngx_event_connect_peer(), and then have to use appropriate
> functions (ngx_ssl_create_connection(), ngx_ssl_handshake(), and
> so on) to initiate an SSL handshake. Once handshake is complete,
> you can use the connection much like any other connection in
> nginx, using c->send(), c->send_chain() and so on. Take a look on
> the ngx_http_upstream.c on how to do this properly.
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Re: Module connecting outside

Maxim Dounin 679 March 09, 2017 08:16AM

Re: Module connecting outside

Antonio Nappa 282 March 21, 2017 09:44AM

Re: Module connecting outside

Maxim Dounin 279 March 21, 2017 09:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 168
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready