Getting Server's Public IP Address via ModSolved

Hey!

I'm aiming to identify a server with a unique ID (so I can store per-server data on my DB) and was thinking the server's public IP address would work for that.

I'm having trouble finding the best way to find the server's IP. I found some old threads referring to Rust.Global.SteamServer but it seems like that no longer works (SteamServer not found in Rust.Global).

Is there a new way to reference the IP address via Steam?

I also tried using https://api.ipify.org/ but it seems to be returning a different IP than what is reported by my dedicated server website (last digit is wrong).

Any ideas?

The IP that is used for web requests would be by default the primary adapter on that machine. You can change which IP it uses in the oxide.confit.json file with a restart following.

Oxide also provides covalence.Server.Address and server.Address as well.

nice, the covalence.Server.Address seems to be the correct one. thanks for the help!

Locked automatically