[GH-ISSUE #75] Local API connections refused as of version 0.0.15 #57

Closed
opened 2026-02-28 14:24:59 +03:00 by kerem · 3 comments
Owner

Originally created by @txoof on GitHub (Sep 1, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/75

I was running an older version (likely 0.0.14 or 13), and updated to 0.0.17. After updating to 0.0.17, I'm unable to connect to the local API. All connections are refused. All other features appear to work as expected.

Perhaps there's been a configuration change? I see that as of dcccf4a, the config schema has been updated, but I'm not sure what's required to get the API setup properly.

I've tested the following versions for API functionality:

  • 0.0.14 - Works as expecte
  • 0.0.15 - Connection Refused
  • 0.0.16 - Connection Refused
  • 0.0.17 - Connection Refused

Build from 0.0.14 result in the following when queried:

$ curl -v http://localhost:24879
*   Trying 127.0.0.1:24879...
* Connected to localhost (127.0.0.1) port 24879 (#0)
> GET / HTTP/1.1
> Host: localhost:24879
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Sun, 01 Sep 2024 17:24:44 GMT
< Content-Length: 2
<
* Connection #0 to host localhost left intact
{}%

Builds from 0.0.15-17 result in the following

$ curl -v http://localhost:24879
*   Trying 127.0.0.1:24879...
* connect to 127.0.0.1 port 24879 failed: Connection refused
*   Trying [::1]:24879...
* connect to ::1 port 24879 failed: Connection refused
* Failed to connect to localhost port 24879 after 0 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to localhost port 24879 after 0 ms: Couldn't connect to server

All versions were built using the following command: env GOARCH=arm64 GOOS=linux CGO_ENABLED=1 go build -o ./go-librespot-daemon ./cmd/daemon

My Configuration File:

device_name: Livingroom-Spotify
log_level: debug
credentials:
  type: zeroconf
device_type: speaker
server_port: 24879
volume_steps: 50
bitrate: 320
initial_volume: 3
Originally created by @txoof on GitHub (Sep 1, 2024). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/75 I was running an older version (likely 0.0.14 or 13), and updated to 0.0.17. After updating to 0.0.17, I'm unable to connect to the local API. All connections are refused. All other features appear to work as expected. Perhaps there's been a configuration change? I see that as of dcccf4a, the config schema has been updated, but I'm not sure what's required to get the API setup properly. I've tested the following versions for API functionality: * 0.0.14 - Works as expecte * 0.0.15 - Connection Refused * 0.0.16 - Connection Refused * 0.0.17 - Connection Refused Build from 0.0.14 result in the following when queried: ```shell $ curl -v http://localhost:24879 * Trying 127.0.0.1:24879... * Connected to localhost (127.0.0.1) port 24879 (#0) > GET / HTTP/1.1 > Host: localhost:24879 > User-Agent: curl/7.88.1 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json < Date: Sun, 01 Sep 2024 17:24:44 GMT < Content-Length: 2 < * Connection #0 to host localhost left intact {}% ``` Builds from 0.0.15-17 result in the following ```shell $ curl -v http://localhost:24879 * Trying 127.0.0.1:24879... * connect to 127.0.0.1 port 24879 failed: Connection refused * Trying [::1]:24879... * connect to ::1 port 24879 failed: Connection refused * Failed to connect to localhost port 24879 after 0 ms: Couldn't connect to server * Closing connection 0 curl: (7) Failed to connect to localhost port 24879 after 0 ms: Couldn't connect to server ``` All versions were built using the following command: `env GOARCH=arm64 GOOS=linux CGO_ENABLED=1 go build -o ./go-librespot-daemon ./cmd/daemon` My Configuration File: ```config device_name: Livingroom-Spotify log_level: debug credentials: type: zeroconf device_type: speaker server_port: 24879 volume_steps: 50 bitrate: 320 initial_volume: 3 ```
kerem closed this issue 2026-02-28 14:24:59 +03:00
Author
Owner

@devgianlu commented on GitHub (Sep 1, 2024):

The configuration changed, see the README.

<!-- gh-comment-id:2323439010 --> @devgianlu commented on GitHub (Sep 1, 2024): The configuration changed, see the [README](https://github.com/devgianlu/go-librespot#api).
Author
Owner

@txoof commented on GitHub (Sep 1, 2024):

🤦🏼 Figured it out. The config file has indeed changed. The key server_port has changed to port and is now nested under the server section. The default behavior is to leave the API disabled.

For anyone else that stumbles on this here's the proper format:

device_name: Livingroom-Spotify
log_level: debug
credentials:
  type: zeroconf
device_type: speaker
server:
  enabled: true
  port: 24879
volume_steps: 50
bitrate: 320
initial_volume: 3
<!-- gh-comment-id:2323439160 --> @txoof commented on GitHub (Sep 1, 2024): 🤦🏼 Figured it out. The config file has indeed changed. The key `server_port` has changed to `port` and is now nested under the `server` section. The default behavior is to leave the API disabled. For anyone else that stumbles on this here's the proper format: ``` device_name: Livingroom-Spotify log_level: debug credentials: type: zeroconf device_type: speaker server: enabled: true port: 24879 volume_steps: 50 bitrate: 320 initial_volume: 3 ```
Author
Owner

@txoof commented on GitHub (Sep 1, 2024):

@devgianlu - Skipped right over that section. Thanks for pointing it out.

<!-- gh-comment-id:2323439462 --> @txoof commented on GitHub (Sep 1, 2024): @devgianlu - Skipped right over that section. Thanks for pointing it out.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#57
No description provided.