mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 21:35:49 +03:00
[GH-ISSUE #92] Websocket not authorised for host #65
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Willyarma on GitHub (Sep 11, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/92
I'm getting this message:
time="2024-09-11T10:43:47+01:00" level=error msg="failed accepting websocket connection" error="failed to accept WebSocket connection: request Origin "http://192.168.5.49:8888" is not authorized for Host "192.168.5.49:3678""
Am I doing something wrong?
config.yml:
device_name: go-librespot
credentials:
type: zeroconf
server:
enabled: true
port: 3678
@Willyarma commented on GitHub (Sep 11, 2024):
I added allow_origin: "http://192.168.5.49:8888" to the config.yml and it only affects the get and post part of the API it does not affect the websocket. Putting "*" dosent work either for websockets but does for get/post.
@Willyarma commented on GitHub (Sep 11, 2024):
I hacked it for the time being just to get it going...
obviously this isnt the right way
@devgianlu commented on GitHub (Sep 15, 2024):
@Willyarma Can you test again with the latest changes?
@Willyarma commented on GitHub (Sep 15, 2024):
I'm using a node.js wrapper that I wrote with a minimal web interface, the HTTP server of it is on port 8888.
Without specifying allow_origin in config.yml, get/post gives cors errors in the firefox web console, the websocket won't connect.
allow_origin: "*" works for both get/post and websockets
allow_origin: "http://192.168.5.49:8888" also works
allow_origin: "192.168.5.49:8888" only works for websockets
Would it be worth mentioning requiring allow_origin in the main readme?
Thanks for fixing it so quickly.
@devgianlu commented on GitHub (Sep 16, 2024):
Added to the README for clarity. Thank you for reporting!