-
Notifications
You must be signed in to change notification settings - Fork 37
Request: Get Server IP #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What about the from cvars import ConVar
ip = ConVar('ip')
print(ip.get_string()) |
@invincibleqc It would probably work, but for which reason is server.udp_port added then? If you could just use "hostport" "hostname" "hostip" etc. |
I simply exposed the whole IServer interface. We can certainly add something like |
We could also add a SERVER_ADDRESS constant to the core package or something like that, as well. |
Any news? :) |
Try this: from urllib.request import urlopen
def get_public_ip():
return urlopen('http://ip.42.pl/raw').read().decode()
print(get_public_ip()) |
Hey,
Could you guys add a way to get the current server ip? I don't like the way to hardcode or use the cvar 'hostip' and im already using
Thanks
The text was updated successfully, but these errors were encountered: