SignalK / freeboard-sk

Chartplotter implementation for Signal K servers
Apache License 2.0
35 stars 27 forks source link

FB not working behind a reverse proxy over https in Docker #159

Open tkurki opened 2 months ago

tkurki commented 2 months ago

I have SK running in Docker behind nginx that handles https. Freeboard is not working, both http and ws are rejected:

image

image

panaaj commented 2 months ago

Have you checked "behind proxy" in the settings? image

tkurki commented 2 months ago

Gmail ate your reply, but that worked.

What does it actyally do? I would rather have it work out of the box.

panaaj commented 2 months ago

By default Freeboard-Sk uses the endpoints discovered in the response to /signalk

  "endpoints": {
    "v1": {
      "version": "2.8.2",
      "signalk-http": "http://192.168.86.32:3000/signalk/v1/api/",
      "signalk-ws": "ws://192.168.86.32:3000/signalk/v1/stream",
      "signalk-tcp": "tcp://192.168.86.32:8375"
    }
  },
  "server": {
    "id": "signalk-server-node",
    "version": "2.8.2"
  }
}

Checking the box uses the protocol:host:port from the browser location rather than the response.

tkurki commented 2 months ago

Ah, own footgun. Hmm, need to think of a way to solve this.

tkurki commented 2 months ago

What if FB primarily tried the server and protocol it was loaded from and secondarily tried the discover endpoint? I think discovery is more useful for discovered servers and standalone clients, less so for webapps.

panaaj commented 2 months ago

Sounds fair. Also sounds like a great reason to create a Signal K client apps best practice guide in the server docs

panaaj commented 1 day ago

Will set proxy mode as the default and include in the next release.