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.


> 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
Subject Author Views Posted

Issuing an HTTP request from a stream module

erankor 426 April 08, 2019 08:18AM

Re: Issuing an HTTP request from a stream module

Roman Arutyunyan 174 April 08, 2019 10:24AM

RE: Issuing an HTTP request from a stream module

erankor 250 April 14, 2019 09:26AM

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

Online Users

Guests: 69
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