spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
259 stars 57 forks source link

supysonic-daemon settings #240

Closed jimToo closed 1 year ago

jimToo commented 1 year ago

Hello,

how can I start the "supysonic-daemon" with the option for supersonic-server to listen on localhost (not on 0.0.0.0)?

background: I am using nginx as reverse proxy

spl0k commented 1 year ago

Hello. The daemon has no influence on which interface the web server listens on. The listening interface can only be set by the arguments used when starting supysonic-server. If you want it to listen on localhost, you can start it this way:

> supysonic-server --host 127.0.0.1

and it will listen on localhost, port 5722.

But since you're planning to use it behind a nginx reverse proxy on the same machine I would recommend using a Unix-domain socket instead. Then you can configure nginx to forward the requests to this socket rather than a inet address. On Supysonic's side it can be done by specifying the --socket argument:

> supysonic-server --socket /path/to/the/socket

All possible arguments can be found on supysonic-server manpage.

jimToo commented 1 year ago

I didn't get that the daemon is independent. (I thought the daemon is starting supysonic-server in background). Thanks for clarification!

I could also access supysonic with a unix-socket. Is this faster or why should I prefer over "localhost".

Greetz Jim

spl0k commented 1 year ago

Both options are viable but I tend to prefer Unix sockets for local communications. Since they don't rely on the TCP stack you could achieve better performance using Unix sockets rather than the loopback interface, but that performance difference will most likely only be relevant when under high traffic.

jimToo commented 1 year ago

thanks a lot! Supysonic is awesome :star:

spl0k commented 1 year ago

Glad you like it :)