jFastCGI / jfastcgi

jFastCGI
Other
38 stars 11 forks source link

Add support for UNIX socket connections (AF_UNIX) to fastcgi server? #14

Closed jtang145 closed 9 years ago

jtang145 commented 10 years ago

Noted that it only support connection by fastcgi tcp connection, is it possible also add support for unix socket connection?

domdorn commented 10 years ago

to support this, I think a JNI Binding is necessary, as JAVA by itself cannot access unix sockets .. there's a third party project that allows this http://code.google.com/p/junixsocket/

if you have time, you could try it out... my next plans where to refactor the code so there is less global state/static access to other classes and maybe even a NIO-implementation of the stream/library.. so we might get some merge conflicts, but if you figure out how to connect it with junixsocket (or another impl) we could integrate this with the new code more easily..

ready to give it a spin? just fork the repo!

cheers, dominik

On Fri, Jun 6, 2014 at 5:36 AM, jerometang notifications@github.com wrote:

Noted that it only support connection by fastcgi tcp connection, is it possible also add support for unix socket connection?

— Reply to this email directly or view it on GitHub https://github.com/jFastCGI/jfastcgi/issues/14.

Dominik Dorn http://dominikdorn.com | http://twitter.com/domdorn XING: https://www.xing.com/profile/Dominik_Dorn LINKEDIN: http://at.linkedin.com/pub/dominik-dorn/66/b42/bb1/

domdorn commented 10 years ago

oh.. I've just seen you mentioned "server" in the bug headline.. .is this really about the server or the client?

jrialland commented 9 years ago

I've just commited an implementation based on https://github.com/caprica/juds

When specifying server endpoints in jfastcgi configuration files, we used to accept the : format, which may now be superseded by a more url-ish syntax : tcp://: The use of Unix sockets may be configured using unix:// -- normally that's all it needs to have unix sockets working.

The juds library uses JNI and comes with a C library that you have to compile...

If I find another good unix socket library based on JNA I will use it instead juds, as I'm a little feared about people who struggle with native libs pushing bug reports about that ..

let me know if you have issues - cheers