Project

General

Profile

[UE] How to setup Unix socket without spawning binary?

Added by N_Aditya over 4 years ago

I am using lighttpd 1.4.54 on ubuntu.

I am working on a website that supports websockets, and I want to write a single multithreaded binary that serves both http and websocket rrquests. First thread of the binary responds to http requests while the second thread responds to websocket requests. First thread is a fastcgi that communicates with lighttpd using unix socket.
Now I want to establish a unix socket between second thread and lighttpd.

fastcgi.server = (
  "" => ((
    "bin-path" => 
    "/home/ubuntu/a.out",
    "socket" => "/home/ubuntu/a.sock",
)))

wstunnel.server = (
  "/websocket" => ((
    "socket" => "/home/ubuntu/b.sock",
)))

In the code, the second thread creates the socket b.sock and is in listening state.
I tried https://redmine.lighttpd.net/issues/469 approach too, but it didn't help.


Replies (1)

RE: How to setup Unix socket without spawning binary? - Added by N_Aditya over 4 years ago

Changing permissions on b.sock solved the problem.

Old permissions were 776,

chmod 777 b.sock

did the trick.

    (1-1/1)