I’m trying to connect to uplink on a self-hosted instance. I am starting it with this command:
/home/user/.local/bin/anvil-app-server --app projectname/ --origin https://websitename --uplink-key code
Here is my uplink code:
anvil.server.connect("password", url="ws://websitename/_/uplink")
The problem is I get this error:
When seeing this, I assumed it was because I was using the wrong port, so I looked in the terminal and saw this:
[INFO anvil.core.server] HTTP Server running on port 51731
[INFO anvil.app-server.run] App URL: https://websitename
[INFO anvil.app-server.dispatch] Launching built-in downlink...
[INFO anvil.app-server.run] SMTP Server running on port 25
Connecting to ws://localhost:51731/_/downlink
Notice it says the port 51731
. I opened the port 51731 on my router and tried connecting to it with that port, and it worked. But when I restarted the Anvil app, the port changed! Every time I restart it, it shows a new port in the terminal. I don’t want to constantly change ports in my router settings. And in the docs, it says that I’m suppost to use the regular port I’m hosting my app on, which is 80/443 (but as I said in the beginning, it failed). My website uses HTTPS, if that helps. What port/URL am I suppost to use? Thanks in advance for help.