Skip to content

Wrong websocket url #302

@gloowa

Description

@gloowa

Hi,

I have a strange configuration issue which I can't solve for a second day.

I've set up spacebar server as a docker container, along with fermi. I've edited respective config files, for now I want to run the server internally on 192.168.10.204. The ports are exposed correctly I think, since the server responds to requests on the ports 3001-3003.

I've edited /src/webpage/instances.json to add following configuration for my instance, and built it with docker build.

"urls": {
  "wellknown": "http://192.168.10.204:8080/",
  "gateway": "http://192.168.10.204:3001/",
  "api": "http://192.168.10.204:3002/",
  "cdn": "http://192.168.10.204:3003/",
}

When running docker copose up, all is good - newsly built image of Fermi was pulled and app seems to connect to the instance and I can create guilds, channells and chat.

However, when I created a voice channel and tried to connect, it fails. I've inspected the Network in the browser tools, and it turns out it tries to open connection to ws://127.0.0.1:3004/ which is not a port or url configured by me anywhere I think. Since my pc is not my server, the connection fails.

What did I do wrong here?

[edit/update]
Ok, I have found a "regions" setting in config.json, and changing it changes the address that is used.
I have also set up a reverse proxy:
spacebar.my.domain (fermi)
gw.spacebar.my.domain (gateway)
api.spacebar.my.domain (api)
cdn.spacebar.my.domain (cdn)

and updated configuration in config.json and fermi.

However, I am still encountering an issue:

When starting a call, a websocket message is sent to wss://gw.spacebar.my.domain/ and the UI says waiting for WS to authorize. However the response from the server is 101 Switching Protocols, after which nothing happens for ~30 seconds and then the call closes. The last output from javascript console in the browser is state changed: wsAuth. After the presumable timeout a message is logged state changed: left.

At the same time, on the gateway following is logged:

$ docker compose logs spacebar-gateway
(...)
spacebar-gateway-1 | [Gateway] New connection from ::ffff:192.168.10.21, total 2
spacebar-gateway-1 | [Gateway/::ffff:192.168.10.21] Unknown opcode 0
spacebar-gateway-1 | [Gateway/<numbers>] VOICE_STATE_UPDATE for user <numbers> in channel <numbers> in guild <numbers> in 64ms

I am not sure how to proceed, since it appears that two-way communication is present between browser, Fermi and the server, yet something prevents sucessful voice connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions