AzuraCast / AzuraCast

A self-hosted web radio management suite, including turnkey installer tools for the full radio software stack and a modern, easy-to-use web app to manage your stations.
https://www.azuracast.com/
GNU Affero General Public License v3.0
3.02k stars 562 forks source link

Websockets connection failed #5902

Closed smilingpeanut closed 1 year ago

smilingpeanut commented 1 year ago

Installation Method

Docker Installation

AzuraCast Release Channel

Rolling Release Channel

Current AzuraCast Version

791396f (2022-12-02 15:27)

What happened?

Updated to latest Rolling Release today and was preparing to update our website code to use WS instead of Nchan and noticed that any attempts to use a Websocket connection to our server using the instructions in the docs fail. The log output comes from the browser console. Verified that the method of WS connection is valid when swapping out to connect to another websocket server.

While I know that CORS issues can sometimes occur with localhost implementations, I've also tried this from several server URLs and the result is the same.

WebSocketManager @ WebSocketManager.js?8970:6
eval @ websocket.client.js?8025:12
_callee2$ @ index.js?f26e:90
tryCatch @ runtime.js?96cf:63
invoke @ runtime.js?96cf:293
eval @ runtime.js?96cf:118
asyncGeneratorStep @ asyncToGenerator.js?1da1:3
_next @ asyncToGenerator.js?1da1:25
WebSocketManager.js?8970:11 WebSocket connection to 'wss://stream.loudspeaker.fm/api/live/nowplaying/websocket' failed: 
connect @ WebSocketManager.js?8970:11
WebSocketManager @ WebSocketManager.js?8970:7
eval @ websocket.client.js?8025:12
_callee2$ @ index.js?f26e:90
tryCatch @ runtime.js?96cf:63
invoke @ runtime.js?96cf:293
eval @ runtime.js?96cf:118
asyncGeneratorStep @ asyncToGenerator.js?1da1:3
_next @ asyncToGenerator.js?1da1:25
WebSocketManager.js?8970:34 Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}

### Relevant log output

```shell
{"level":"info","origin":"http://localhost:3000","time":"2022-12-03T20:14:39Z","message":"request Origin is not authorized due to empty allowed_origins"}
{"level":"info","origin":"http://localhost:3000","time":"2022-12-03T20:14:43Z","message":"request Origin is not authorized due to empty allowed_origins"}
{"level":"info","origin":"http://localhost:3000","time":"2022-12-03T20:14:48Z","message":"request Origin is not authorized due to empty allowed_origins"}
{"level":"info","origin":"http://localhost:3000","time":"2022-12-03T20:14:52Z","message":"request Origin is not authorized due to empty allowed_origins"}
{"level":"info","origin":"http://localhost:3000","time":"2022-12-03T20:15:00Z","message":"request Origin is not authorized due to empty allowed_origins"}
BusterNeece commented 1 year ago

@smilingpeanut Thank you for the report. Fix deploying now. Didn't notice in testing as we had same origin in our tests.

smilingpeanut commented 1 year ago

Thank you so much!