Welcome! Log In Create A New Profile

Advanced

Re: Raw socket answer (non-http request reply)

Jan Moskyto Matejka
August 28, 2015 07:42AM
On Fri, Aug 28, 2015 at 12:04:07PM +0300, Ilja Razinkov wrote:
> i have to handle raw socket connections in simple manner: any
> connection to specific port should be served with predefined data
> (text string), without http headers, wrappings, etc.
>
> Is it possible to do with nginx? May be there is plugin or something similar.
>
> To be specific - i wish to serve Adobe socket policy file on 843 port.
> It is important, that server should send policy request strictly
> "as-is", without additional content inside raw socket answer

If I understand correctly, you want this:
- client opens connection, server accepts it
- client sends nothing
- server sends a pre-defined file
- server closes connection

Assuming you have a linux server, simple inetd service is enough.

/etc/inetd.conf:
....
adobe stream tcp nowait nobody cat /path/to/the/file/to/be/sent
....

/etc/services:
....
adobe 843/tcp
....

Both these files should include the given lines, the ... means there are
other lines that should probably be kept.

Not tested, but should work. No nginx needed, it's an overkill for this.

Moskyto

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Raw socket answer (non-http request reply)

Ilja Razinkov August 28, 2015 05:06AM

Re: Raw socket answer (non-http request reply)

Jan Moskyto Matejka August 28, 2015 07:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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