Your config definitely looks wrong:
ws://my-ip:443
- It seems like here you're using non-HTTPS WebSocket with HTTPS port.https://my-ip:443
- Here you have HTTPS with an IP address, which is not possible.How to configure proxy to use my API URL?
I tryed to modify at vite.config and ChangeServerPage. But I get error because the aplication in PROD hit in my domain of the frontend.
You have to set up an external proxy.
External proxy at vite.config?
I made this:
server: {
proxy: {
"/api": {
target: "https://api.mydomain.com.br",
changeOrigin: true,
secure: false,
ws: true,
},
},
But my fetch("/api/server")
at ServerProvider didn't get my api url. Have other file where I set API configuration?
Vite proxy is just for debugging. You need a proper proxy.
Hello, great?
My backend has an IP and I use it in the browser to see the status. Ok, it's correct. However, I put this IP in vite.config.ts and ChangeServerPage.
At vite.config.ts
proxy: { "/api/socket": "ws://my-ip:443", "/api": "https://my-ip:443", },
At ChangeServerPage
const officialServers = [ "https://my-ip:443", "https://my-ip", "http://my-ip:8082", currentServer, ];
Do I need something more? I'm getting 404.