#tauri localhost not able to assign localhost in build

16 messages · Page 1 of 1 (latest)

outer phoenix
#

I was trying to build my app with the plugin localhost and the app is unable to connect. when I lauch the release binary via the terminal I got this ouptut

thread '<unnamed>' panicked at 'Unable to spawn server: Os { code: 99, kind: AddrNotAvailable, message: "Cannot assign requested address" }', /home/thomas/.cargo/git/checkouts/plugins-workspace-fd0259fcb18f51ad/6647e6e/plugins/localhost/src/lib.rs:66:68 ```

I also I added my main.rs. 
Also I noticed this only happen in the release binary but the dev binary is ok.
patent egret
#

Something else is running on port 1420, most likely the dev server is still running.

outer phoenix
patent egret
#

The connection refused message is definitely because of the localhost server not starting. Not sure what the issue is if it can't grab 1420, it's not in the privileged range of 1-1023.

#

Do you have any firewall settings blocking ports?

#

Actually, it can't be that since it works on dev.

#

I wonder if 0.0.0.0 is too ambiguous.

#

In your tauri.conf.json, what is the distDir set to?

outer phoenix
#

"distDir": "../dist",

patent egret
#

Hm... then it should bundle whatever file is in that folder. Does axum serve content from a different port than what it's bound to?

patent egret
#

I'm not familiar with axum at all but if it serves content to the port specified by axum::Server::bind, it would need to be 1420 since Tauri is listening to that port only.

#

Oh, it looks like that's just the Server struct from hyper. Then it definitely serves on that port. You'll have to do a dev check for the port again.

patent egret
#

I tried using your code and I get the same error but during dev with a Vite TypeScript project.

#

Do you get that same error if you change the port number?

outer phoenix
#

Yeah

#

I think I will create a issue for it on the plugins repo