Welcome! Log In Create A New Profile

Advanced

Re: Issuing an HTTP request from a stream module

Roman Arutyunyan
April 08, 2019 10:24AM
Hi Eran,

On Mon, Apr 08, 2019 at 12:16:00PM +0000, Eran Kornblau wrote:
> Hi all,
>
> I would like to issue HTTP requests from an nginx stream module.
> In my understanding, I need to use ngx_event_connect_peer to connect, and implement my own write/read event handlers
> in order to build the request/parse the response.

Yes.

> Is there some other solution that takes advantage of all the code that already exists in nginx for doing that?
> Also, does anyone happen to have some code that does something similar?

In nginx source there are at least 2 examples of how to write an HTTP client:

- OCSP stapling (src/event/ngx_event_openssl_stapling.c)
- mail_auth module (src/mail/ngx_mail_auth_http_module.c)

Also, the HTTP proxy module does this as well, but the entire module is much
more complicated.

--
Roman Arutyunyan
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Issuing an HTTP request from a stream module

erankor 206 April 08, 2019 08:18AM

Re: Issuing an HTTP request from a stream module

Roman Arutyunyan 69 April 08, 2019 10:24AM

RE: Issuing an HTTP request from a stream module

erankor 98 April 14, 2019 09:26AM



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

Online Users

Guests: 88
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready