Tunneling request through a different socket connection?
December 28, 2014 06:13PM
Hi, I am not sure if this is possible somehow (either by using out-of-the box Nginx or by writing some Nginx module).
I did not managed do find yet a problem description similar to mine on the net or in the Nginx Module Extension book.
(But this does not mean the info might not be available somewhere.. )

Anyways, here is my scenario. (The scenario might sound strange, but C1 below is part of a private API and C2 is part of a public API. C1 and C2 are bridged through Nginx.)
C1 is a client socket connecting over a TCP/IP connection to Nginx. Over C1 are mostly async messages sent over the same "persistent" socket connection. These async messages are received by Nginx, transformed and then dropped in a DB.

C2 is a client socket connecting over HTTP to Nginx. Over C2, REST request are intended to be sent/tunneled (via Nginx) to C1. C1, after receiving & processing the REST request, would reply (via Nginx) to C2.
So the question would be: can Nginx be configured / programmed in such a way, that certain (or all) HTTP requests to be tunneled through specific & existing Nginx socket connections (such as C1)?
I would appreciate any help and/or pointers to further documentation which I did not found so far.

Kind regards,
M.



Edited 2 time(s). Last edit at 12/28/2014 06:18PM by module_learner.
Re: Tunneling request through a different socket connection?
December 29, 2014 04:39AM
The above could be a more complicated architectural approach to achieve communication, which reduces overhead to a minimum.
However the message based approach could make the above scenario easier by using a reverse proxy configuration for Nginx.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready