phenomen / flc

Foundry Lightweight Client (FLC) is a bloat-free client app for Foundry VTT
https://flc.ruleplaying.com/
33 stars 9 forks source link

Cannot connect with self-hosted foundry with proxy and ssl #17

Closed Lank891 closed 11 months ago

Lank891 commented 1 year ago

I've got interested in the project since one of my players cannot use Foundry from a browser. I love it, and I started using it (and recommend all my players to use it tbh). Apart from some functionalities I'm missing, but this is not about them, I have the following problem,

I'm hosting my Foundry in Oracle Cloud and it is set up with SSL and Nginx. It couldn't detect that my server is on (/api/status), it seems there were 2 reasons for it:

  1. Nginx was responding with 400 automatically, due to the API call not containing the Host header.
  2. Tauri Fetch didn't recognize the SSL certificate I'm using (not self-signed or anything like that, and I haven't yet seen problems with this certificate)

My workarounds were:

  1. Adding "Host": new URL(server.host).hostname into the headers of API status call
  2. Replacing tauri_fetch with plain fetch (+ small amount of following changes needed for this to work)

Those worked (and my group is using my custom build of 2.9.5), but since this thing is being updated I thought I should share those problems. I can make a PR for that with my changes, although I didn't test them against other foundries, at least yet.

phenomen commented 11 months ago

I removed all extraneous server checks and made it possible to join whatever URL you want.